From 622928470f5ccf3ada5e61611fd9b54a712585f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Tue, 5 Dec 2023 11:53:43 +0100 Subject: [PATCH] fix(UI): Fix disable PiP when using documentPictureInPicture (#5992) Fixes https://github.com/shaka-project/shaka-player/issues/5991 --- ui/controls.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/controls.js b/ui/controls.js index 95d2fafad4..8465ca57c2 100644 --- a/ui/controls.js +++ b/ui/controls.js @@ -652,7 +652,8 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget { isPiPAllowed() { if ('documentPictureInPicture' in window && this.config_.preferDocumentPictureInPicture) { - return true; + const video = /** @type {HTMLVideoElement} */(this.localVideo_); + return !video.disablePictureInPicture; } if (document.pictureInPictureEnabled) { const video = /** @type {HTMLVideoElement} */(this.localVideo_);