Skip to content

Commit 6e222ff

Browse files
committed
fix: empty last frame on video knob
1 parent 38c19ac commit 6e222ff

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "svelte-knobs",
33
"description": "Svelte component library for building customizable knob controls.",
4-
"version": "0.3.1",
4+
"version": "0.3.2",
55
"repository": {
66
"url": "https://github.com/eye-wave/svelte-knobs"
77
},

src/lib/VideoKnob.svelte

+2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@
8787
let i = -1;
8888
8989
async function decodeFrame() {
90+
if (video.currentTime >= video.duration) return;
9091
if (!dctx) throw Error('Failed to create canvas context');
92+
9193
dctx.clearRect(0, 0, decoderCanvas.width, decoderCanvas.height);
9294
dctx.drawImage(video, 0, 0, decoderCanvas.width, decoderCanvas.height);
9395

0 commit comments

Comments
 (0)