Merge pull request #1873 from thornbill/fix-pip-iphone

Fix iOS PiP support detection
This commit is contained in:
Bond-009 2020-08-31 21:42:23 +02:00 committed by GitHub
commit 40bf679b88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)) {