1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

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.
This commit is contained in:
Anthony Lavado 2019-02-04 03:28:54 -05:00
parent abaac9cc01
commit c99f9c6d65

View file

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