Bug 1302310 - Make the width of video control match video container. r=jaws draft
authorRay Lin <ralin@mozilla.com>
Mon, 21 Nov 2016 10:21:28 +0800
changeset 442270 8b7b4060fcb9f9d4cf1cc8db8b9d0c327c0b2799
parent 442068 0534254e9a40b4bade2577c631fe4cfa0b5db41d
child 537755 1456bbd43fdb3a13e39e168d1964c3573ef623f3
push id36649
push userbmo:ralin@mozilla.com
push dateTue, 22 Nov 2016 05:47:45 +0000
reviewersjaws
bugs1302310
milestone53.0a1
Bug 1302310 - Make the width of video control match video container. r=jaws MozReview-Commit-ID: B2pyiVfXBMF
toolkit/content/widgets/videocontrols.xml
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -1610,32 +1610,16 @@
                   if (!this.controlBar.minWidth || this.videocontrols.isTouchControls) {
                     return;
                   }
 
                   let videoWidth = this.video.clientWidth;
                   let videoHeight = this.video.clientHeight;
                   const minControlBarPaddingWidth = 18;
 
-                  if (this.video.readyState >= this.video.HAVE_METADATA) {
-                    if (!this.isAudioOnly && this.video.videoWidth && this.video.videoHeight) {
-                      let rect = this.video.getBoundingClientRect();
-                      let widthRatio = rect.width / this.video.videoWidth;
-                      let heightRatio = rect.height / this.video.videoHeight;
-                      let resizedWidth = this.video.videoWidth * Math.min(widthRatio, heightRatio);
-
-                      this.controlsContainer.style.width = `${resizedWidth}px`;
-                      this.controlsContainer.style.left = `${(videoWidth - resizedWidth) / 2}px`;
-
-                      videoWidth = resizedWidth;
-                    } else {
-                      this.controlsContainer.style.width = "";
-                      this.controlsContainer.style.left = "";
-                    }
-                  }
                   // Hide and show control in order.
                   const prioritizedControls = [
                     this.playButton,
                     this.muteButton,
                     this.fullscreenButton,
                     this.closedCaptionButton,
                     this.positionDurationBox,
                     this.scrubberStack,