From eefc1e8ca665f50ec5fe776b9f0bdef0a53c3ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beaufort?= Date: Thu, 11 May 2023 08:57:44 +0000 Subject: [PATCH] Document Picture-in-Picture: Use width/height instead of initialAspectRatio --- externs/pictureinpicture.js | 1 - ui/pip_button.js | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/externs/pictureinpicture.js b/externs/pictureinpicture.js index 12f92e193a..e850b5e156 100644 --- a/externs/pictureinpicture.js +++ b/externs/pictureinpicture.js @@ -53,7 +53,6 @@ HTMLMediaElement.prototype.webkitPresentationMode; /** * @typedef {{ - * initialAspectRatio: (number|undefined), * width: (number|undefined), * height: (number|undefined), * copyStyleSheets: (boolean|undefined), diff --git a/ui/pip_button.js b/ui/pip_button.js index f33aa216ce..34f5a9b93b 100644 --- a/ui/pip_button.js +++ b/ui/pip_button.js @@ -162,7 +162,8 @@ shaka.ui.PipButton = class extends shaka.ui.Element { const pipPlayer = this.videoContainer_; const rectPipPlayer = pipPlayer.getBoundingClientRect(); const pipWindow = await window.documentPictureInPicture.requestWindow({ - initialAspectRatio: rectPipPlayer.width / rectPipPlayer.height, + width: rectPipPlayer.width, + height: rectPipPlayer.height, copyStyleSheets: true, });