mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 08:01:20 -08:00
refactor(core): CORE-09 isolate source operations and settle cancelled switches
This commit is contained in:
1 parent
874dac9f22
commit
44f4e083a9
29 files changed
+4512
-255
No files matched your search
@@ -0,0 +1,10 @@
|
||||
import type { SwitchHost, SwitchMethods } from '../source/types'
|
||||
import { switchSource } from '../source/switch'
|
||||
import { def } from '../utils'
|
||||
|
||||
export default function switchMix(art: SwitchHost): asserts art is SwitchHost & SwitchMethods {
|
||||
const switchUrl = (url: string) => switchSource(art, url, 0)
|
||||
def(art, 'switchQuality', { value: (url: string) => switchSource(art, url, art.currentTime) })
|
||||
def(art, 'switchUrl', { value: switchUrl })
|
||||
def(art, 'switch', { set: switchUrl })
|
||||
}
|
||||
Reference in new issue
Block a user