Fix "muted=false + volume=0" case.

We need to handle two types of "mute":
- Volume icon is pressed to mute.
- Volume slider moved to 0%.
This commit is contained in:
infiinte-persistence 2020-06-11 20:55:30 +02:00 committed by Sean Yesmunt
parent 662778c47b
commit d01c20394e

View file

@ -114,12 +114,15 @@ export default React.memo<Props>(function VideoJs(props: Props) {
function unmuteAndHideHint() { function unmuteAndHideHint() {
if (player) { if (player) {
player.muted(false); player.muted(false);
if (player.volume() === 0) {
player.volume(1.0);
}
} }
showTapToUnmute(false); showTapToUnmute(false);
} }
function onInitialPlay() { function onInitialPlay() {
if (player && player.muted()) { if (player && (player.muted() || player.volume() === 0)) {
// The css starts as "hidden". We make it visible here without // The css starts as "hidden". We make it visible here without
// re-rendering the whole thing. // re-rendering the whole thing.
showTapToUnmute(true); showTapToUnmute(true);