fix mpv progress interval still running after queue ends

This commit is contained in:
jeffvli
2026-04-03 18:58:58 -07:00
parent 3c42355c1e
commit f3a6027e6d
2 changed files with 15 additions and 3 deletions
@@ -216,6 +216,10 @@ export const MpvPlayerEngine = (props: MpvPlayerEngineProps) => {
return;
}
if (playerStatus !== PlayerStatus.PLAYING) {
return;
}
const updateProgress = async () => {
if (!mpvPlayer || !isMountedRef.current) {
return;
@@ -245,7 +249,7 @@ export const MpvPlayerEngine = (props: MpvPlayerEngineProps) => {
progressIntervalRef.current = null;
}
};
}, [hasCurrentSong, isTransitioning, onProgress]);
}, [hasCurrentSong, isTransitioning, onProgress, playerStatus]);
const { mediaAutoNext } = usePlayerActions();