Bug 1302310 - Make the width of video control match video container. r=jaws

MozReview-Commit-ID: B2pyiVfXBMF

--HG--
extra : rebase_source : 6ce4768f338a02d7789a71e9ca02a15c940ecd7b
This commit is contained in:
Ray Lin 2016-11-21 10:21:28 +08:00
Родитель 89e92b0c3b
Коммит e6fe42b1fa
1 изменённых файлов: 0 добавлений и 16 удалений

Просмотреть файл

@ -1615,22 +1615,6 @@
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,