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(() => {
|
useEffect(() => {
|
||||||
if (interrupt) {
|
if (interrupt) {
|
||||||
stop(url);
|
stop(url);
|
||||||
|
setPlaying(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!playing(url) && previousInterrupt) {
|
if (!playing(url) && previousInterrupt) {
|
||||||
play();
|
play();
|
||||||
|
setPlaying(true);
|
||||||
}
|
}
|
||||||
}, [interrupt, play, playing, previousInterrupt, stop, url]);
|
}, [interrupt, play, playing, previousInterrupt, stop, url]);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user