From 390585b38169b8c4b8256dbe80dee33bfddca69f Mon Sep 17 00:00:00 2001 From: Midori Kochiya Date: Thu, 28 Dec 2023 20:59:52 +0800 Subject: [PATCH 1/2] Allow Picture-in-Picture on mobile devices --- public/js/client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/client.js b/public/js/client.js index e8605fd4..ab33e02b 100644 --- a/public/js/client.js +++ b/public/js/client.js @@ -131,10 +131,10 @@ console.log('LOCAL_STORAGE_SETTINGS', lsSettings); const isEmbedded = window.self !== window.top; // Check if PIP is supported by this browser -const showVideoPipBtn = !isMobileDevice && document.pictureInPictureEnabled; +const showVideoPipBtn = document.pictureInPictureEnabled; // Check if Document PIP is supported by this browser -const showDocumentPipBtn = !isMobileDevice && !isEmbedded && 'documentPictureInPicture' in window; +const showDocumentPipBtn = !isEmbedded && 'documentPictureInPicture' in window; /** * Configuration for controlling the visibility of buttons in the MiroTalk P2P client. From 78e94a85ab3151f264ba7d5ade8ed81efd796589 Mon Sep 17 00:00:00 2001 From: Midori Kochiya Date: Thu, 28 Dec 2023 21:02:10 +0800 Subject: [PATCH 2/2] Make `showVideoPipBtn` a boolean --- public/js/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/client.js b/public/js/client.js index ab33e02b..c6ae1670 100644 --- a/public/js/client.js +++ b/public/js/client.js @@ -131,7 +131,7 @@ console.log('LOCAL_STORAGE_SETTINGS', lsSettings); const isEmbedded = window.self !== window.top; // Check if PIP is supported by this browser -const showVideoPipBtn = document.pictureInPictureEnabled; +const showVideoPipBtn = !!document.pictureInPictureEnabled; // Check if Document PIP is supported by this browser const showDocumentPipBtn = !isEmbedded && 'documentPictureInPicture' in window;