Save video playback position in browser localstorage

This commit is contained in:
Pixeldrain-Server committed 2025-03-12 17:44:18 +01:00
1 parent 335012bdb8
commit 00e24879b7
5 files changed
+126 -3

No files matched your search

+3 -1
View File
@@ -1,5 +1,6 @@
<script>
import { onMount, createEventDispatcher, tick } from "svelte";
import { onMount, createEventDispatcher, tick } from "svelte";
import { video_position } from "../../lib/VideoPosition.mjs";
import { fs_path_url } from "../FilesystemAPI.mjs";
let dispatch = createEventDispatcher()
@@ -107,6 +108,7 @@ const video_keydown = e => {
on:play={() => playing = true }
on:ended={() => dispatch("open_sibling", 1)}
on:keydown={video_keydown}
use:video_position={() => $nav.base.sha256_sum.substring(0, 8)}
>
<source src={fs_path_url($nav.base.path)} type={$nav.base.file_type} />
</video>