Bug 1536169 - Get rid of extra whitespace around Picture-in-Picture player. r=JSON_voorhees

Differential Revision: https://phabricator.services.mozilla.com/D23909

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Conley 2019-03-18 19:30:48 +00:00
Родитель 6743c7ace2
Коммит f3e4364617
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -135,14 +135,14 @@ var PictureInPicture = {
// that means we need to _divide_ the MAX_WIDTH by the aspect ratio to
// calculate the appropriate height.
resultWidth = MAX_WIDTH;
resultHeight = Math.floor(MAX_WIDTH / aspectRatio);
resultHeight = Math.round(MAX_WIDTH / aspectRatio);
} else {
// We're clamping the height, so the width must be adjusted to match
// the original aspect ratio. Since aspect ratio is width over height,
// this means we need to _multiply_ the MAX_HEIGHT by the aspect ratio
// to calculate the appropriate width.
resultHeight = MAX_HEIGHT;
resultWidth = Math.floor(MAX_HEIGHT * aspectRatio);
resultWidth = Math.round(MAX_HEIGHT * aspectRatio);
}
}
@ -153,7 +153,7 @@ var PictureInPicture = {
let pipLeft = screenWidth.value - resultWidth;
let pipTop = screenHeight.value - resultHeight;
let features = `${PLAYER_FEATURES},top=${pipTop},left=${pipLeft},` +
`width=${resultWidth},height=${resultHeight}`;
`outerWidth=${resultWidth},outerHeight=${resultHeight}`;
let pipWindow =
Services.ww.openWindow(parentWin, PLAYER_URI, null, features, null);