mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-01-11 22:40:31 +00:00
Merge pull request #874 from Stremio/chore/player-when-volume-is-0-set-as-mute
Some checks are pending
Build / build (push) Waiting to run
Some checks are pending
Build / build (push) Waiting to run
chore: ControlBar & VolumeChangeIndicator show volume=0 with muted icon
This commit is contained in:
commit
970538b087
2 changed files with 9 additions and 7 deletions
|
|
@ -131,9 +131,10 @@ const ControlBar = ({
|
|||
name={
|
||||
(typeof muted === 'boolean' && muted) ? 'volume-mute' :
|
||||
(volume === null || isNaN(volume)) ? 'volume-off' :
|
||||
volume < 30 ? 'volume-low' :
|
||||
volume < 70 ? 'volume-medium' :
|
||||
'volume-high'
|
||||
volume === 0 ? 'volume-mute' :
|
||||
volume < 30 ? 'volume-low' :
|
||||
volume < 70 ? 'volume-medium' :
|
||||
'volume-high'
|
||||
}
|
||||
/>
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -14,11 +14,12 @@ const VolumeChangeIndicator = React.memo(({ muted, volume }) => {
|
|||
const prevVolume = React.useRef(volume);
|
||||
|
||||
const iconName = React.useMemo(() => {
|
||||
return typeof muted === 'boolean' && muted ? 'volume-mute' :
|
||||
return (typeof muted === 'boolean' && muted) ? 'volume-mute' :
|
||||
volume === null || isNaN(volume) ? 'volume-off' :
|
||||
volume < 30 ? 'volume-low' :
|
||||
volume < 70 ? 'volume-medium' :
|
||||
'volume-high';
|
||||
volume === 0 ? 'volume-mute' :
|
||||
volume < 30 ? 'volume-low' :
|
||||
volume < 70 ? 'volume-medium' :
|
||||
'volume-high';
|
||||
}, [muted, volume]);
|
||||
|
||||
React.useEffect(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue