Title: [279319] trunk/Source/WebCore
Revision
279319
Author
[email protected]
Date
2021-06-27 12:17:19 -0700 (Sun, 27 Jun 2021)

Log Message

Backgrounding and returning to a FaceTime call in MobileSafari leads to a blank black sreen
https://bugs.webkit.org/show_bug.cgi?id=227406

Reviewed by Eric Carlson.

The `RequireUserGestureForFullscreen` restriction will be kept in a `MediaElementSession`
if the corresponding media element is `autoplay`. Therefore, the request to enter
picture-in-picture from the UI process will be ignored by the media element, and the
state machine managing video presentation mode in the UI process will be an inconsistent state.

This patch creates a `UserGestureIndicator` before requesting the media element
to change its presentation mode to make sure the request will be handled.

* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::fullscreenModeChanged):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (279318 => 279319)


--- trunk/Source/WebCore/ChangeLog	2021-06-27 19:16:51 UTC (rev 279318)
+++ trunk/Source/WebCore/ChangeLog	2021-06-27 19:17:19 UTC (rev 279319)
@@ -1,3 +1,21 @@
+2021-06-27  Peng Liu  <[email protected]>
+
+        Backgrounding and returning to a FaceTime call in MobileSafari leads to a blank black sreen
+        https://bugs.webkit.org/show_bug.cgi?id=227406
+
+        Reviewed by Eric Carlson.
+
+        The `RequireUserGestureForFullscreen` restriction will be kept in a `MediaElementSession`
+        if the corresponding media element is `autoplay`. Therefore, the request to enter
+        picture-in-picture from the UI process will be ignored by the media element, and the
+        state machine managing video presentation mode in the UI process will be an inconsistent state.
+
+        This patch creates a `UserGestureIndicator` before requesting the media element
+        to change its presentation mode to make sure the request will be handled.
+
+        * platform/cocoa/VideoFullscreenModelVideoElement.mm:
+        (WebCore::VideoFullscreenModelVideoElement::fullscreenModeChanged):
+
 2021-06-27  Alan Bujtas  <[email protected]>
 
         [LFC][TFC] Add support for shrinking over-constrained columns based on the width type priority list

Modified: trunk/Source/WebCore/platform/cocoa/VideoFullscreenModelVideoElement.mm (279318 => 279319)


--- trunk/Source/WebCore/platform/cocoa/VideoFullscreenModelVideoElement.mm	2021-06-27 19:16:51 UTC (rev 279318)
+++ trunk/Source/WebCore/platform/cocoa/VideoFullscreenModelVideoElement.mm	2021-06-27 19:17:19 UTC (rev 279319)
@@ -192,8 +192,10 @@
 
 void VideoFullscreenModelVideoElement::fullscreenModeChanged(HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode)
 {
-    if (m_videoElement)
+    if (m_videoElement) {
+        UserGestureIndicator gestureIndicator(ProcessingUserGesture, &m_videoElement->document());
         m_videoElement->setPresentationMode(HTMLVideoElement::toPresentationMode(videoFullscreenMode));
+    }
 }
 
 void VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID(CompletionHandler<void(RouteSharingPolicy, String)>&& completionHandler)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to