Bug 495162 - Show the HTML5 video control bar during volumechange. r=gijs
authorJared Wein <jwein@mozilla.com>
Thu, 05 May 2016 08:35:00 -0400
changeset 296380 26c8641039836d44fde70b1887116b22febdc58a
parent 296379 ce2501a5f268283105549cc5316a35ca938c099f
child 296381 0e4859aa979d693ace332a960d929fa863951ce3
push id76311
push usercbook@mozilla.com
push dateFri, 06 May 2016 12:26:12 +0000
treeherdermozilla-inbound@84a3e5716801 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs
bugs495162
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 495162 - Show the HTML5 video control bar during volumechange. r=gijs
toolkit/content/widgets/videocontrols.xml
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -561,16 +561,24 @@
                             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 click-to-play overlay has already
+                            // been hidden (we don't hide controls when the overlay is visible).
+                            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;