fix: playback stopped dep

This commit is contained in:
Fredrik Burmester
2024-11-27 09:35:26 +01:00
parent ea06efb82e
commit a1a895815a

View File

@@ -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({