mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 10:41:20 -08:00
refactor(core): CORE-11 split media events and scope reconnect lifetimes
This commit is contained in:
1 parent
5e31274f1d
commit
b8039ad1f1
27 files changed
+4844
-475
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import type { MediaEventHost } from '../media/events/types'
|
||||
import { forwardMediaEvents } from '../media/events/forward'
|
||||
import { listenMedia } from '../media/events/listen'
|
||||
import { installEnded, installPlaybackUI } from '../media/events/playback'
|
||||
import { installReadiness } from '../media/events/readiness'
|
||||
import { createReconnect } from '../media/events/reconnect'
|
||||
|
||||
export default function eventInit(art: MediaEventHost): void {
|
||||
forwardMediaEvents(art)
|
||||
const reconnect = createReconnect(art)
|
||||
installReadiness(art, reconnect)
|
||||
installEnded(art)
|
||||
listenMedia(art, 'video:error', reconnect.schedule)
|
||||
installPlaybackUI(art, reconnect)
|
||||
}
|
||||
Reference in new issue
Block a user