1
0
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:
Kevin Litchfield 2017-02-15 15:23:47 -05:00 committed by Brandon Casey
parent c3b1d689f6
commit 3c1108c5dc

View File

@ -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);