autounmute
Signed-off-by: ale <ale@manalejandro.com>
This commit is contained in:
parent
3783888f74
commit
3c7daa9d43
@ -8,7 +8,7 @@ const App = () => {
|
||||
[bounce, setBounce] = useState(''),
|
||||
[json, setJson] = useState({}),
|
||||
[currentVolume, setCurrentVolume] = useState(0.5),
|
||||
[muted, setMuted] = useState(false),
|
||||
[muted, setMuted] = useState(true),
|
||||
[link, setLink] = useState(''),
|
||||
[title, setTitle] = useState('Stream Radio'),
|
||||
[currentListeners, setCurrentListeners] = useState(0),
|
||||
@ -102,7 +102,10 @@ const App = () => {
|
||||
<div>
|
||||
<h2>Audio Controls</h2>
|
||||
{audioElmRef.current?.paused ?
|
||||
<button onClick={() => audioElmRef.current?.play()}>Play ⏯️</button> :
|
||||
<button onClick={() => {
|
||||
setMuted(false)
|
||||
audioElmRef.current?.play()
|
||||
}}>Play ⏯️</button> :
|
||||
<button onClick={() => audioElmRef.current?.pause()}>Pause ⏯️</button>
|
||||
}
|
||||
<br /><br />
|
||||
|
Loading…
x
Reference in New Issue
Block a user