From b001bc9a16cddc47a501511daa47bf3bf165b9aa Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Mon, 31 Aug 2020 12:37:01 -0400 Subject: [PATCH] Fix iOS PiP support detection --- src/plugins/htmlVideoPlayer/plugin.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index 88329fecff..a3bee29370 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -1390,7 +1390,12 @@ function tryRemoveElement(elem) { const list = []; const video = document.createElement('video'); - if (video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === 'function' || document.pictureInPictureEnabled) { + if ( + // Check non-standard Safari PiP support + typeof video.webkitSupportsPresentationMode === 'function' && video.webkitSupportsPresentationMode('picture-in-picture') && typeof video.webkitSetPresentationMode === 'function' + // Check standard PiP support + || document.pictureInPictureEnabled + ) { list.push('PictureInPicture'); } else if (window.Windows) { if (Windows.UI.ViewManagement.ApplicationView.getForCurrentView().isViewModeSupported(Windows.UI.ViewManagement.ApplicationViewMode.compactOverlay)) {