diff --git a/src/App.js b/src/App.js index 9296745..9634153 100644 --- a/src/App.js +++ b/src/App.js @@ -13,9 +13,7 @@ const App = () => { [title, setTitle] = useState('Stream Radio'), [currentListeners, setCurrentListeners] = useState(0), [maxListeners, setMaxListeners] = useState(0), - [playPause, setPlayPause] = useState(false), audioElmRef = useRef(null), - once = useRef(false), audioAnalyzer = () => { const audioCtx = new (window.AudioContext || window.webkitAudioContext)(), analyzer = audioCtx.createAnalyser() @@ -30,18 +28,6 @@ const App = () => { } setAnalyzerData({ analyzer, bufferLength, dataArray }) }, - play = () => { - if (audioElmRef.current) { - audioElmRef.current.play() - setPlayPause(true) - } - }, - pause = () => { - if (audioElmRef.current) { - audioElmRef.current.pause() - setPlayPause(false) - } - }, loadData = () => { fetch('/stream.json').then(response => response.json()).then(json => { setJson(json) @@ -115,9 +101,9 @@ const App = () => {