Title: [254512] trunk/Source/WebCore
Revision
254512
Author
peng.l...@apple.com
Date
2020-01-14 08:37:10 -0800 (Tue, 14 Jan 2020)

Log Message

A video element cannot enter fullscreen from PiP mode
https://bugs.webkit.org/show_bug.cgi?id=204468

Reviewed by Eric Carlson.

This patch fixes two issues:
- Make sure the message exchanges between WebContent and UI process can complete in the scenario that switching to fullscreen from PiP.
- Do not send fullscreenModeChanged event with mode = 3 (both fullscreen and Picture-in-Picture) to WebContent process.

We need to use API tests to verify the fix.
No new tests are added because of webkit.org/b/203724.

* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::doEnterFullscreen):
(VideoFullscreenInterfaceAVKit::setMode):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (254511 => 254512)


--- trunk/Source/WebCore/ChangeLog	2020-01-14 16:22:00 UTC (rev 254511)
+++ trunk/Source/WebCore/ChangeLog	2020-01-14 16:37:10 UTC (rev 254512)
@@ -1,3 +1,22 @@
+2020-01-14  Peng Liu  <peng.l...@apple.com>
+
+        A video element cannot enter fullscreen from PiP mode
+        https://bugs.webkit.org/show_bug.cgi?id=204468
+
+        Reviewed by Eric Carlson.
+
+        This patch fixes two issues:
+        - Make sure the message exchanges between WebContent and UI process can complete in the scenario that switching to fullscreen from PiP.
+        - Do not send fullscreenModeChanged event with mode = 3 (both fullscreen and Picture-in-Picture) to WebContent process.
+
+        We need to use API tests to verify the fix.
+        No new tests are added because of webkit.org/b/203724.
+
+        * platform/ios/VideoFullscreenInterfaceAVKit.mm:
+        (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
+        (VideoFullscreenInterfaceAVKit::doEnterFullscreen):
+        (VideoFullscreenInterfaceAVKit::setMode):
+
 2020-01-14  Philippe Normand  <pnorm...@igalia.com>
 
         [GStreamer] Unreviewed build warning fix after r254503

Modified: trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm (254511 => 254512)


--- trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm	2020-01-14 16:22:00 UTC (rev 254511)
+++ trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm	2020-01-14 16:37:10 UTC (rev 254512)
@@ -1078,6 +1078,9 @@
 
         if (m_exitFullscreenNeedsExitPictureInPicture)
             doExitFullscreen();
+
+        if (m_enterFullscreenNeedsExitPictureInPicture)
+            doEnterFullscreen();
         return;
     }
 
@@ -1325,6 +1328,7 @@
     [[m_playerViewController view] layoutIfNeeded];
     if (m_targetMode.hasFullscreen() && !m_currentMode.hasFullscreen()) {
         m_enterFullscreenNeedsEnterFullscreen = true;
+        [m_window setHidden:NO];
         [m_playerViewController enterFullScreenAnimated:YES completionHandler:[this, protectedThis = makeRefPtr(this)] (BOOL success, NSError *error) {
             enterFullscreenHandler(success, error);
         }];
@@ -1476,8 +1480,10 @@
         return;
 
     m_currentMode.setMode(mode);
+    // Mode::mode() can be 3 (VideoFullscreenModeStandard | VideoFullscreenModePictureInPicture).
+    // HTMLVideoElement does not expect such a value in the fullscreenModeChanged() callback.
     if (m_videoFullscreenModel)
-        m_videoFullscreenModel->fullscreenModeChanged(m_currentMode.mode());
+        m_videoFullscreenModel->fullscreenModeChanged(mode);
 }
 
 void VideoFullscreenInterfaceAVKit::clearMode(HTMLMediaElementEnums::VideoFullscreenMode mode)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to