mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-16 09:36:16 -08:00
fix(PKG-AUTO-THUMB-11): isolate frame handler cleanup failures
This commit is contained in:
1 parent
a8d19ce5ef
commit
eb6402fdca
16 files changed
+2892
-36
No files matched your search
@@ -19,17 +19,15 @@ export default function createFrameReader(job: ExtractionJob, video: HTMLVideoEl
|
||||
function clear() {
|
||||
const previous = pending
|
||||
pending = undefined
|
||||
video.onloadeddata = null
|
||||
video.onseeked = null
|
||||
if (!previous)
|
||||
return
|
||||
const result = cleanupAll([
|
||||
() => { video.onloadeddata = null },
|
||||
() => { video.onseeked = null },
|
||||
() => {
|
||||
if (previous.timer !== null)
|
||||
if (previous && previous.timer !== null)
|
||||
clearTimeout(previous.timer)
|
||||
},
|
||||
() => {
|
||||
if (previous.frame !== null)
|
||||
if (previous && previous.frame !== null)
|
||||
video.cancelVideoFrameCallback(previous.frame)
|
||||
},
|
||||
])
|
||||
|
||||
Reference in new issue
Block a user