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 03aa24f commit 34ef347Copy full SHA for 34ef347
src/hooks/useAudioControl.ts
@@ -112,10 +112,14 @@ export function useAudioControl(options: UseAudioControlOptions) {
112
}, [])
113
114
const mute = useCallback(() => {
115
- ;(audioElementRef?.current as HTMLAudioElement).muted = true
+ if (audioElementRef.current) {
116
+ audioElementRef.current.muted = true
117
+ }
118
119
const unmute = useCallback(() => {
- ;(audioElementRef?.current as HTMLAudioElement).muted = false
120
121
+ audioElementRef.current.muted = false
122
123
124
125
return {
0 commit comments