mirror of
https://github.com/videojs/video.js.git
synced 2025-03-29 22:07:10 +02:00
fix: Set MuteButton controlText correctly (#4056)
This commit is contained in:
parent
c3b1d689f6
commit
3c1108c5dc
@ -88,7 +88,8 @@ class MuteToggle extends Button {
|
||||
// Don't rewrite the button text if the actual text doesn't change.
|
||||
// This causes unnecessary and confusing information for screen reader users.
|
||||
// This check is needed because this function gets called every time the volume level is changed.
|
||||
const toMute = this.player_.muted() ? 'Unmute' : 'Mute';
|
||||
const soundOff = this.player_.muted() || this.player_.volume() === 0;
|
||||
const toMute = soundOff ? 'Unmute' : 'Mute';
|
||||
|
||||
if (this.controlText() !== toMute) {
|
||||
this.controlText(toMute);
|
||||
|
Loading…
x
Reference in New Issue
Block a user