From 65581958e137fbed83d88d060856fd759b3ad9ed Mon Sep 17 00:00:00 2001 From: Anthony Lavado Date: Sun, 3 Feb 2019 03:34:50 -0500 Subject: [PATCH 1/5] Enable and fix PiP for Safari This enables the previously commented out lines that would enable Picture in Picture support for Safari. Also fixed IF condition to match the Apple developer reccomendation: https://developer.apple.com/documentation/webkitjs/adding_picture_in_picture_to_your_safari_media_controls --- .../emby-webcomponents/htmlvideoplayer/plugin.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js b/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js index 10d32bc9bd..b52e317920 100644 --- a/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js +++ b/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js @@ -1443,9 +1443,9 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa var list = []; var video = document.createElement('video'); - //if (video.webkitSupportsPresentationMode && video.webkitSupportsPresentationMode('picture-in-picture') && typeof video.webkitSetPresentationMode === "function") { - // list.push('PictureInPicture'); - //} + if (video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === "function") { + list.push('PictureInPicture'); + } if (document.pictureInPictureEnabled) { list.push('PictureInPicture'); } @@ -1849,4 +1849,4 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa } return HtmlVideoPlayer; -}); \ No newline at end of file +}); From abaac9cc012ebb02e69d8a7c83a8c3082e598c7b Mon Sep 17 00:00:00 2001 From: Anthony Lavado Date: Sun, 3 Feb 2019 03:38:52 -0500 Subject: [PATCH 2/5] Add Anthony to list, fix the links of others Adds my name to the list, and fixes the broken links for the other users before me. --- CONTRIBUTORS.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 6ae333bdee..9a343ddd15 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -16,9 +16,10 @@ - [grafixeyehero](https://github.com/grafixeyehero) - [Drago96](https://github.com/drago-96) - [ViXXoR](https://github.com/ViXXoR) - - [nkmerrill] (https://github.com/nkmerrill) - - [TtheCreator] (https://github.com/Tthecreator) + - [nkmerrill](https://github.com/nkmerrill) + - [TtheCreator](https://github.com/Tthecreator) - [RazeLighter777](https://github.com/RazeLighter777) + - [anthonylavado](https://github.com/anthonylavado) # Emby Contributors From c99f9c6d656e2259f90b2995074d11e78b5104d6 Mon Sep 17 00:00:00 2001 From: Anthony Lavado Date: Mon, 4 Feb 2019 03:28:54 -0500 Subject: [PATCH 3/5] 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 From 8ec57de307a03b85614e751229d5353f5661a22a Mon Sep 17 00:00:00 2001 From: Claus Vium Date: Mon, 4 Feb 2019 03:56:41 -0500 Subject: [PATCH 4/5] Update src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js Co-Authored-By: anthonylavado --- .../emby-webcomponents/htmlvideoplayer/plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js b/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js index 7c13d57785..45b0ae0d33 100644 --- a/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js +++ b/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js @@ -1443,7 +1443,7 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa var list = []; var video = document.createElement('video'); - if ((video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === "function") || (document.pictureInPictureEnabled)) { + if (video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === "function" || document.pictureInPictureEnabled) { list.push('PictureInPicture'); } From d7cef56e235a29481cc5966209285641184e324f Mon Sep 17 00:00:00 2001 From: Claus Vium Date: Mon, 4 Feb 2019 10:00:26 -0500 Subject: [PATCH 5/5] Update src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js Remove extra newline Co-Authored-By: anthonylavado --- .../emby-webcomponents/htmlvideoplayer/plugin.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js b/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js index 45b0ae0d33..19b075b622 100644 --- a/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js +++ b/src/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js @@ -1446,7 +1446,6 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa 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