From a1a895815aab481a31731afabfd91402fe00c567 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Wed, 27 Nov 2024 09:35:26 +0100 Subject: [PATCH] fix: playback stopped dep --- app/(auth)/player/transcoding-player.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/(auth)/player/transcoding-player.tsx b/app/(auth)/player/transcoding-player.tsx index db52c5e8..8fba5a57 100644 --- a/app/(auth)/player/transcoding-player.tsx +++ b/app/(auth)/player/transcoding-player.tsx @@ -224,12 +224,6 @@ const Player = () => { videoRef.current?.pause(); }, [videoRef]); - const stop = useCallback(() => { - setIsPlaybackStopped(true); - videoRef.current?.pause(); - reportPlaybackStopped(); - }, [videoRef]); - const seek = useCallback( (seconds: number) => { videoRef.current?.seek(seconds); @@ -248,6 +242,12 @@ const Player = () => { revalidateProgressCache(); }; + const stop = useCallback(() => { + setIsPlaybackStopped(true); + videoRef.current?.pause(); + reportPlaybackStopped(); + }, [videoRef, reportPlaybackStopped]); + const reportPlaybackStart = async () => { if (!item?.Id) return; await getPlaystateApi(api!).onPlaybackStart({