From 51b6250760231ec7c5dc0cf8c18e366928dc40f8 Mon Sep 17 00:00:00 2001 From: ale Date: Tue, 20 May 2025 01:56:54 +0200 Subject: [PATCH] audio load Signed-off-by: ale --- src/App.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 ? - : + : }