From c99f9c6d656e2259f90b2995074d11e78b5104d6 Mon Sep 17 00:00:00 2001 From: Anthony Lavado Date: Mon, 4 Feb 2019 03:28:54 -0500 Subject: [PATCH] Stacks the condition for Safari support and Chrome support all in to one This puts the IF condition for detecting Chrome PiP support into the same line as the one that sets it up for Safari. I tested it in both browsers, as well as Firefox. In browsers where PiP is supported, they each respond to their own call and not the other (Safari only responds to the Webkit check, Chrome only responds to the document check). Firefox currently supports neither standard, so there's no issue there. --- .../emby-webcomponents/htmlvideoplayer/plugin.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js b/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js index b52e317920..7c13d57785 100644 --- a/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js +++ b/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js @@ -1443,12 +1443,10 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa var list = []; var video = document.createElement('video'); - if (video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === "function") { - list.push('PictureInPicture'); - } - if (document.pictureInPictureEnabled) { + if ((video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === "function") || (document.pictureInPictureEnabled)) { list.push('PictureInPicture'); } + else if (browser.ipad) { // Unfortunately this creates a false positive on devices where its' not actually supported