mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 14:41:20 -08:00
fix(auto-thumbnail): [PKG-AUTO-THUMB-07] release terminal canvas storage
This commit is contained in:
1 parent
e93d3cbb67
commit
7be628a983
19 files changed
+4544
-15
No files matched your search
@@ -27,10 +27,20 @@ export default function extract(job: ExtractionJob, config: ExtractionConfig) {
|
||||
video.style.width = `${videoWidth}px`
|
||||
video.style.height = `${videoHeight}px`
|
||||
const canvas = document.createElement('canvas')
|
||||
job.own(() => {
|
||||
canvas.height = 0
|
||||
})
|
||||
job.own(() => {
|
||||
canvas.width = 0
|
||||
})
|
||||
if (!job.active())
|
||||
return
|
||||
canvas.width = canvasWidth
|
||||
if (!job.active())
|
||||
return
|
||||
canvas.height = canvasHeight
|
||||
if (!job.active())
|
||||
return
|
||||
const ctx = canvas.getContext('2d')
|
||||
if (!ctx)
|
||||
throw new Error('Auto-thumbnail canvas context is unavailable')
|
||||
|
||||
Reference in new issue
Block a user