From 2bce3a50e5970d4bfaca4a67169e97f11eec063d Mon Sep 17 00:00:00 2001 From: Hakadao Date: Tue, 8 Oct 2024 02:19:54 +0800 Subject: [PATCH] chore(pip-window): set the default width and height --- src/components/PipWindow.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/PipWindow.vue b/src/components/PipWindow.vue index 857659c3..40b86d5f 100644 --- a/src/components/PipWindow.vue +++ b/src/components/PipWindow.vue @@ -25,8 +25,12 @@ async function openPipWindow() { // https://developer.chrome.com/docs/web-platform/document-picture-in-picture if ('documentPictureInPicture' in window) { // The Document Picture-in-Picture API is supported. + const width = window.innerWidth * 0.8 + const height = window.innerHeight * 0.8 pipWindowEl.value = await (window as any).documentPictureInPicture.requestWindow({ disallowReturnToOpener: true, + width, + height, }) pipWindowEl.value.document.body.style.padding = '0' pipWindowEl.value.document.body.style.margin = '0'