mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-05-20 17:12: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={
|
name={
|
||||||
(typeof muted === 'boolean' && muted) ? 'volume-mute' :
|
(typeof muted === 'boolean' && muted) ? 'volume-mute' :
|
||||||
(volume === null || isNaN(volume)) ? 'volume-off' :
|
(volume === null || isNaN(volume)) ? 'volume-off' :
|
||||||
volume < 30 ? 'volume-low' :
|
volume === 0 ? 'volume-mute' :
|
||||||
volume < 70 ? 'volume-medium' :
|
volume < 30 ? 'volume-low' :
|
||||||
'volume-high'
|
volume < 70 ? 'volume-medium' :
|
||||||
|
'volume-high'
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,12 @@ const VolumeChangeIndicator = React.memo(({ muted, volume }) => {
|
||||||
const prevVolume = React.useRef(volume);
|
const prevVolume = React.useRef(volume);
|
||||||
|
|
||||||
const iconName = React.useMemo(() => {
|
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 === null || isNaN(volume) ? 'volume-off' :
|
||||||
volume < 30 ? 'volume-low' :
|
volume === 0 ? 'volume-mute' :
|
||||||
volume < 70 ? 'volume-medium' :
|
volume < 30 ? 'volume-low' :
|
||||||
'volume-high';
|
volume < 70 ? 'volume-medium' :
|
||||||
|
'volume-high';
|
||||||
}, [muted, volume]);
|
}, [muted, volume]);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue