Fix background playback: remove duplicate hidden-tab play effect
This commit is contained in:
parent
d04ab733d2
commit
4310098949
1 changed files with 0 additions and 15 deletions
|
|
@ -34,20 +34,5 @@ export function useBackgroundState({ activeHowl, isPlaying, keepPlayingInBackgro
|
||||||
};
|
};
|
||||||
}, [isPlaying, activeHowl, keepPlayingInBackground]);
|
}, [isPlaying, activeHowl, keepPlayingInBackground]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!document.hidden || !activeHowl || !isPlaying) return;
|
|
||||||
|
|
||||||
if (keepPlayingInBackground) {
|
|
||||||
if (!activeHowl.playing()) {
|
|
||||||
activeHowl.play();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activeHowl.playing()) {
|
|
||||||
activeHowl.pause();
|
|
||||||
}
|
|
||||||
}, [activeHowl, isPlaying, keepPlayingInBackground]);
|
|
||||||
|
|
||||||
return isBackgrounded;
|
return isBackgrounded;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue