mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Play/Stop sound after interrupt
This commit is contained in:
1 file changed
+2
@@ -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]);
|
||||
|
||||
|
||||
Reference in new issue
Block a user