mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 17:51:20 -08:00
refactor(mediabunny): [PKG-MB-05] own video iterators, frame pools and rendering
This commit is contained in:
1 parent
5d0b128483
commit
9d037dcbf9
27 files changed
+3652
-595
No files matched your search
@@ -45,6 +45,15 @@ export default class MediaBunnyEngine implements EnginePort {
|
||||
dropLateFrames: option.dropLateFrames ?? false,
|
||||
poster: option.poster ?? '',
|
||||
preflightRange: option.preflightRange ?? false,
|
||||
onError: (error) => {
|
||||
try {
|
||||
this.pause()
|
||||
}
|
||||
catch (failure) {
|
||||
console.warn('MediaBunny video failure cleanup:', failure)
|
||||
}
|
||||
this.reportError(error)
|
||||
},
|
||||
})
|
||||
this.paused = true
|
||||
this.ended = false
|
||||
@@ -72,6 +81,7 @@ export default class MediaBunnyEngine implements EnginePort {
|
||||
return
|
||||
const id = ++this.loadSeq
|
||||
this.#playback.invalidate()
|
||||
this.video.cancelPending()
|
||||
this.loadSession?.cancel()
|
||||
if (id !== this.loadSeq || this.destroyed)
|
||||
return
|
||||
@@ -96,6 +106,7 @@ export default class MediaBunnyEngine implements EnginePort {
|
||||
return
|
||||
const failed = ++this.loadSeq
|
||||
this.#playback.invalidate()
|
||||
this.video.cancelPending()
|
||||
session.cancel()
|
||||
if (failed !== this.loadSeq || this.destroyed)
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user