Title: [186979] trunk/Source/WebCore
Revision
186979
Author
[email protected]
Date
2015-07-17 17:30:16 -0700 (Fri, 17 Jul 2015)

Log Message

Picture in Picture interacts poorly with AirPlay/HDMI
https://bugs.webkit.org/show_bug.cgi?id=147061
<rdar://problem/19192076>

Reviewed by Tim Horton.

When we are actively playing to an external target, the
picture in picture button should be hidden.

Also, the availability of picture in picture is also
dependent on AirPlay, so that we don't auto-pip when
we're displaying on a TV.

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.configureInlineControls): Call the update function.
(ControllerIOS.prototype.updatePictureInPictureButton): Add or remove a hidden class.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::allowsPictureInPicture): Check Airplay status.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (186978 => 186979)


--- trunk/Source/WebCore/ChangeLog	2015-07-18 00:20:35 UTC (rev 186978)
+++ trunk/Source/WebCore/ChangeLog	2015-07-18 00:30:16 UTC (rev 186979)
@@ -1,3 +1,24 @@
+2015-07-17  Dean Jackson  <[email protected]>
+
+        Picture in Picture interacts poorly with AirPlay/HDMI
+        https://bugs.webkit.org/show_bug.cgi?id=147061
+        <rdar://problem/19192076>
+
+        Reviewed by Tim Horton.
+
+        When we are actively playing to an external target, the
+        picture in picture button should be hidden.
+
+        Also, the availability of picture in picture is also
+        dependent on AirPlay, so that we don't auto-pip when
+        we're displaying on a TV.
+
+        * Modules/mediacontrols/mediaControlsiOS.js:
+        (ControllerIOS.prototype.configureInlineControls): Call the update function.
+        (ControllerIOS.prototype.updatePictureInPictureButton): Add or remove a hidden class.
+        * html/MediaElementSession.cpp:
+        (WebCore::MediaElementSession::allowsPictureInPicture): Check Airplay status.
+
 2015-07-17  Tim Horton  <[email protected]>
 
         [iOS] TextIndicator has a large forehead when line-height > 1

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js (186978 => 186979)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js	2015-07-18 00:20:35 UTC (rev 186978)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js	2015-07-18 00:30:16 UTC (rev 186979)
@@ -193,8 +193,7 @@
             // Hide the scrubber on audio until the user starts playing.
             this.controls.timelineBox.classList.add(this.ClassNames.hidden);
         } else {
-            if (Controller.gSimulatePictureInPictureAvailable || ('webkitSupportsPresentationMode' in this.video && this.video.webkitSupportsPresentationMode('picture-in-picture')))
-                this.controls.panel.appendChild(this.controls.pictureInPictureButton);
+            this.updatePictureInPictureButton();
             this.controls.panel.appendChild(this.controls.fullscreenButton);
         }
     },
@@ -573,6 +572,16 @@
         Controller.prototype.setShouldListenForPlaybackTargetAvailabilityEvent.call(this, shouldListen);
     },
 
+    updatePictureInPictureButton: function()
+    {
+        var shouldShowPictureInPictureButton = Controller.gSimulatePictureInPictureAvailable || ('webkitSupportsPresentationMode' in this.video && this.video.webkitSupportsPresentationMode('picture-in-picture'));
+        if (shouldShowPictureInPictureButton) {
+            this.controls.panel.appendChild(this.controls.pictureInPictureButton);
+            this.controls.pictureInPictureButton.classList.remove(this.ClassNames.hidden);
+        } else
+            this.controls.pictureInPictureButton.classList.add(this.ClassNames.hidden);
+    },
+
     handlePresentationModeChange: function(event)
     {
         var presentationMode = this.presentationMode();

Modified: trunk/Source/WebCore/html/MediaElementSession.cpp (186978 => 186979)


--- trunk/Source/WebCore/html/MediaElementSession.cpp	2015-07-18 00:20:35 UTC (rev 186978)
+++ trunk/Source/WebCore/html/MediaElementSession.cpp	2015-07-18 00:30:16 UTC (rev 186979)
@@ -382,7 +382,7 @@
 bool MediaElementSession::allowsPictureInPicture(const HTMLMediaElement& element) const
 {
     Settings* settings = element.document().settings();
-    return settings && settings->allowsPictureInPictureMediaPlayback();
+    return settings && settings->allowsPictureInPictureMediaPlayback() && !element.webkitCurrentPlaybackTargetIsWireless();
 }
 
 #if ENABLE(MEDIA_SOURCE)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to