Play/Stop sound after interrupt

This commit is contained in:
J Francisco Rader committed 2021-03-02 09:31:25 -05:00
1 parent c37f6a66b4
commit e037a9b0f8
1 file changed
+2
+2
View File
@@ -68,10 +68,12 @@ const useSound = (url: string, options: ISoundOptions = DEFAULT_OPTIONS) => {
useEffect(() => {
if (interrupt) {
stop(url);
setPlaying(false);
return;
}
if (!playing(url) && previousInterrupt) {
play();
setPlaying(true);
}
}, [interrupt, play, playing, previousInterrupt, stop, url]);