Bug 495162 - Show the HTML5 video control bar during volumechanges. r?gijs draft
authorJared Wein <jwein@mozilla.com>
Thu, 05 May 2016 11:00:30 -0400
changeset 363798 53e08870f410d7fa635c67cb9426cb376643cd9c
parent 358018 cc898e5dfa22a5263e34488baccd32c2ca275f30
child 520129 58d68a99e40a19084e9d4524f822834a3360b658
push id17300
push userjwein@mozilla.com
push dateThu, 05 May 2016 15:00:37 +0000
reviewersgijs
bugs495162
milestone49.0a1
Bug 495162 - Show the HTML5 video control bar during volumechanges. r?gijs MozReview-Commit-ID: KP2Vvy7Rk40
toolkit/content/widgets/videocontrols.xml
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -561,16 +561,23 @@
                             this.setupStatusFader();
                             break;
                         case "volumechange":
                             var volume = this.video.muted ? 0 : this.video.volume;
                             var volumePercentage = Math.round(volume * 100);
                             this.updateMuteButtonState();
                             this.volumeControl.value = volumePercentage;
                             this.volumeForeground.style.paddingRight = (1 - volume) * this._volumeControlWidth + "px";
+                            // Show the controls to highlight the changing volume,
+                            // but only if the controls can get hidden.
+                            if (this.clickToPlay.hidden) {
+                                this.startFadeIn(this.controlBar);
+                                clearTimeout(this._hideControlsTimeout);
+                                this._hideControlsTimeout = setTimeout(this._hideControlsFn, this.HIDE_CONTROLS_TIMEOUT_MS);
+                            }
                             break;
                         case "loadedmetadata":
                             this.adjustControlSize();
                             // If a <video> doesn't have any video data, treat it as <audio>
                             // and show the controls (they won't fade back out)
                             if (this.video instanceof HTMLVideoElement &&
                                 (this.video.videoWidth == 0 || this.video.videoHeight == 0)) {
                                 this.isAudioOnly = true;