diff --git a/src/App.js b/src/App.js index b0a192c..e47c81c 100644 --- a/src/App.js +++ b/src/App.js @@ -50,7 +50,11 @@ const App = () => { }).catch(err => { console.error('Error fetching data: ' + err.message) }) - } + }, + play = useCallback(async () => { + setMuted(false) + await audioElmRef.current?.play() + }, [audioElmRef.current]) useEffect(() => { if (json?.media?.track[0] && bounce.search(json?.media?.track[0].Title) === -1) { setBounce('Now Playing: ') @@ -102,10 +106,7 @@ const App = () => {

Audio Controls

{audioElmRef.current?.paused ? - : + : }