We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1aadee commit ded4eb4Copy full SHA for ded4eb4
src/hooks/useAudioControl.ts
@@ -55,6 +55,13 @@ function useCreateAudioElement(
55
56
useEffect(() => {
57
return () => {
58
+ const audio = audioElementRef.current
59
+ // Properly stop the <audio> playing
60
+ // https://stackoverflow.com/a/14836099/6840562
61
+ if (audio) {
62
+ audio.pause()
63
+ audio.currentTime = 0
64
+ }
65
audioElementRef.current = undefined
66
}
67
}, [])
0 commit comments