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:
parent
662778c47b
commit
d01c20394e
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue