diff --git a/src/components/player/Player.tsx b/src/components/player/Player.tsx index febade1..354f0ce 100644 --- a/src/components/player/Player.tsx +++ b/src/components/player/Player.tsx @@ -238,7 +238,7 @@ const listenHandler = ( } }; -const Player = ({ currentEntryList, children }: any, ref: any) => { +const Player = ({ currentEntryList, muted, children }: any, ref: any) => { const dispatch = useAppDispatch(); const player1Ref = useRef(); const player2Ref = useRef(); @@ -634,6 +634,7 @@ const Player = ({ currentEntryList, children }: any, ref: any) => { player1Ref.current.audioEl.current.src = getSrc1(); } }} + muted={muted} crossOrigin="anonymous" /> { player2Ref.current.audioEl.current.src = getSrc2(); } }} + muted={muted} crossOrigin="anonymous" /> {children} diff --git a/src/components/player/PlayerBar.tsx b/src/components/player/PlayerBar.tsx index 5f41081..0151d28 100644 --- a/src/components/player/PlayerBar.tsx +++ b/src/components/player/PlayerBar.tsx @@ -48,6 +48,7 @@ const PlayerBar = () => { const [manualSeek, setManualSeek] = useState(0); const [currentEntryList, setCurrentEntryList] = useState('entry'); const [localVolume, setLocalVolume] = useState(Number(settings.getSync('volume'))); + const [muted, setMuted] = useState(false); const playersRef = useRef(); const history = useHistory(); @@ -278,7 +279,7 @@ const PlayerBar = () => { }; return ( - + {playQueue.showDebugWindow && } @@ -686,14 +687,11 @@ const PlayerBar = () => { {/* Volume Slider */} 0.7 - ? 'volume-up' - : playQueue.volume === 0 - ? 'volume-off' - : 'volume-down' + muted ? 'volume-off' : playQueue.volume > 0.7 ? 'volume-up' : 'volume-down' } + onClick={() => setMuted(!muted)} size="lg" - style={{ marginRight: '15px', padding: '0' }} + style={{ cursor: 'pointer', marginRight: '15px', padding: '0' }} />