Bug 1302310 - Make the width of video control match video container. r=jaws
authorRay Lin <ralin@mozilla.com>
Mon, 21 Nov 2016 10:21:28 +0800
changeset 323962 23673ee58feadb330621489546d1277ad3a7c488
parent 323961 25b4cc6088ef59bcccf2499bf9c0e3e921164b2c
child 323963 84fee6da47a6df048b50d1c710070aa9aee47152
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +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,