Skip to content
Snippets Groups Projects
Commit 3bcd8f41 authored by Christian Bager Bach Houmann's avatar Christian Bager Bach Houmann
Browse files

feat: add seeking in podcast episode

parent 39fc2ec4
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,22 @@
currentTime.set(percent * $duration);
}
let isDragging: boolean = false;
function onDragStart() {
isDragging = true;
}
function onDragEnd() {
isDragging = false;
}
function handleDragging(e: MouseEvent) {
if (!isDragging) return;
onClickProgressbar(e);
}
onMount(() => {
const playedEps = $playedEpisodes;
const currentEp = $currentEpisode;
......@@ -153,6 +169,9 @@
max={$duration}
value={$currentTime}
on:click={onClickProgressbar}
on:mousedown={onDragStart}
on:mouseup={onDragEnd}
on:mousemove={handleDragging}
/>
<span>{formatSeconds($duration - $currentTime, "HH:mm:ss")}</span>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment