diff options
Diffstat (limited to 'toolkit/content/widgets/videocontrols.js')
-rw-r--r-- | toolkit/content/widgets/videocontrols.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/toolkit/content/widgets/videocontrols.js b/toolkit/content/widgets/videocontrols.js index 73a32164aa..8d7b52c344 100644 --- a/toolkit/content/widgets/videocontrols.js +++ b/toolkit/content/widgets/videocontrols.js @@ -417,10 +417,9 @@ this.VideoControlsImplWidget = class { } // We have to check again if the media has audio here. - if (!this.isAudioOnly && !this.video.mozHasAudio) { - this.muteButton.setAttribute("noAudio", "true"); - this.muteButton.disabled = true; - } + let noAudio = !this.isAudioOnly && !this.video.mozHasAudio; + this.muteButton.toggleAttribute("noAudio", noAudio); + this.muteButton.disabled = noAudio; } // The video itself might not be fullscreen, but part of the @@ -755,7 +754,7 @@ this.VideoControlsImplWidget = class { ); } break; - case "loadedmetadata": + case "loadedmetadata": { // If a <video> doesn't have any video data, treat it as <audio> // and show the controls (they won't fade back out) if ( @@ -771,13 +770,13 @@ this.VideoControlsImplWidget = class { Math.round(this.video.currentTime * 1000), Math.round(this.video.duration * 1000) ); - if (!this.isAudioOnly && !this.video.mozHasAudio) { - this.muteButton.setAttribute("noAudio", "true"); - this.muteButton.disabled = true; - } + let noAudio = !this.isAudioOnly && !this.video.mozHasAudio; + this.muteButton.toggleAttribute("noAudio", noAudio); + this.muteButton.disabled = noAudio; this.adjustControlSize(); this.updatePictureInPictureToggleDisplay(); break; + } case "durationchange": this.updatePictureInPictureToggleDisplay(); break; |