@@ -84,7 +82,7 @@ export function ProgressBar() {
left: `${mousePos}%`,
}}
>
-
+
) : null}
diff --git a/src/components/player/internals/ThumbnailScraper.tsx b/src/components/player/internals/ThumbnailScraper.tsx
index 34d457a1..e4f9ac08 100644
--- a/src/components/player/internals/ThumbnailScraper.tsx
+++ b/src/components/player/internals/ThumbnailScraper.tsx
@@ -74,6 +74,7 @@ class ThumnbnailWorker {
this.canvasEl.height
);
const imgUrl = this.canvasEl.toDataURL();
+ if (this.interrupted) return;
this.cb({
at,
data: imgUrl,
@@ -84,13 +85,20 @@ class ThumnbnailWorker {
const vid = this.videoEl;
if (!vid) return;
await this.initVideo();
- if (this.interrupted) return;
- await this.takeSnapshot(vid.duration / 2);
+
+ // TODO make a queue based on refinement algorithm
+
+ const queue = [0.5, 0.25, 0.75];
+ for (let i = 0; i < queue.length; i += 1) {
+ if (this.interrupted) return;
+ await this.takeSnapshot(vid.duration * queue[i]);
+ }
}
}
export function ThumbnailScraper() {
const addImage = usePlayerStore((s) => s.thumbnails.addImage);
+ const meta = usePlayerStore((s) => s.meta);
const source = usePlayerStore((s) => s.source);
const workerRef = useRef