diff --git a/src/ui/PodcastView/EpisodePlayer.svelte b/src/ui/PodcastView/EpisodePlayer.svelte index 82432b7..7889be7 100644 --- a/src/ui/PodcastView/EpisodePlayer.svelte +++ b/src/ui/PodcastView/EpisodePlayer.svelte @@ -114,16 +114,7 @@ let srcPromise: Promise = getSrc($currentEpisode); - // #region Keep player time and currentTime in sync - // Simply binding currentTime to the audio element will result in resets. - // Hence the following solution. - let playerTime: number = 0; - onMount(() => { - const unsub = currentTime.subscribe((ct) => { - playerTime = ct; - }); - // This only happens when the player is open and the user downloads the episode via the context menu. // So we want to update the source of the audio element to local file / online stream. const unsubDownloadedSource = downloadedEpisodes.subscribe(_ => { @@ -139,18 +130,12 @@ }); return () => { - unsub(); unsubDownloadedSource(); unsubCurrentEpisode(); unsubVolume(); }; }); - $: { - currentTime.set(playerTime); - } - // #endregion - onDestroy(() => { playedEpisodes.setEpisodeTime($currentEpisode, $currentTime, $duration, ($currentTime === $duration)); isPaused.set(true); @@ -234,7 +219,7 @@