Title: [262508] trunk/Source/WebKit
Revision
262508
Author
[email protected]
Date
2020-06-03 12:45:55 -0700 (Wed, 03 Jun 2020)

Log Message

[iOS] Hide the PiP button in fullscreen mode if PiP is disabled in preferences
https://bugs.webkit.org/show_bug.cgi?id=212699
<rdar://problem/60391437>

Reviewed by Eric Carlson.

In r260474, we hid the PiP button in fullscreen when PiP was unsupported on the
current device; we must also hide the PiP button when clients have disabled PiP
via preferences.

* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController videoControlsManagerDidChange]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (262507 => 262508)


--- trunk/Source/WebKit/ChangeLog	2020-06-03 19:41:50 UTC (rev 262507)
+++ trunk/Source/WebKit/ChangeLog	2020-06-03 19:45:55 UTC (rev 262508)
@@ -1,3 +1,18 @@
+2020-06-03  Jer Noble  <[email protected]>
+
+        [iOS] Hide the PiP button in fullscreen mode if PiP is disabled in preferences
+        https://bugs.webkit.org/show_bug.cgi?id=212699
+        <rdar://problem/60391437>
+
+        Reviewed by Eric Carlson.
+
+        In r260474, we hid the PiP button in fullscreen when PiP was unsupported on the
+        current device; we must also hide the PiP button when clients have disabled PiP
+        via preferences.
+
+        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
+        (-[WKFullScreenViewController videoControlsManagerDidChange]):
+
 2020-06-03  Kate Cheney  <[email protected]>
 
         Any active sqlite transactions for the ITP database should be aborted when the network process suspends.

Modified: trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm (262507 => 262508)


--- trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm	2020-06-03 19:41:50 UTC (rev 262507)
+++ trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm	2020-06-03 19:45:55 UTC (rev 262508)
@@ -265,7 +265,11 @@
 
     WebCore::PlaybackSessionModel* playbackSessionModel = playbackSessionInterface ? playbackSessionInterface->playbackSessionModel() : nullptr;
     self.playing = playbackSessionModel ? playbackSessionModel->isPlaying() : NO;
-    [_pipButton setHidden:!playbackSessionModel || !playbackSessionModel->isPictureInPictureSupported()];
+    bool isPiPEnabled = false;
+    if (auto page = [self._webView _page])
+        isPiPEnabled = page->preferences().pictureInPictureAPIEnabled() && page->preferences().allowsPictureInPictureMediaPlayback();
+    bool isPiPSupported = playbackSessionModel && playbackSessionModel->isPictureInPictureSupported();
+    [_pipButton setHidden:!isPiPEnabled || !isPiPSupported];
 }
 
 - (void)setPrefersStatusBarHidden:(BOOL)value
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to