Title: [254212] trunk/Source/WebCore
- Revision
- 254212
- Author
- [email protected]
- Date
- 2020-01-08 11:56:13 -0800 (Wed, 08 Jan 2020)
Log Message
After playing a video and making it full screen, the video exits full screen and stops but the audio continues to play
https://bugs.webkit.org/show_bug.cgi?id=205896
Patch by Peng Liu <[email protected]> on 2020-01-08
Reviewed by Jer Noble.
AVKit calls playerViewController:shouldExitFullScreenWithReason in the scenario that the exit fullscreen request
is from the web process (e.g., through _javascript_ API videoElement.webkitExitFullscreen()).
We have to ignore the callback in that case.
No new tests, covered by existing tests.
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::exitFullscreen):
(VideoFullscreenInterfaceAVKit::cleanupFullscreen):
(VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (254211 => 254212)
--- trunk/Source/WebCore/ChangeLog 2020-01-08 19:50:14 UTC (rev 254211)
+++ trunk/Source/WebCore/ChangeLog 2020-01-08 19:56:13 UTC (rev 254212)
@@ -1,3 +1,23 @@
+2020-01-08 Peng Liu <[email protected]>
+
+ After playing a video and making it full screen, the video exits full screen and stops but the audio continues to play
+ https://bugs.webkit.org/show_bug.cgi?id=205896
+
+ Reviewed by Jer Noble.
+
+ AVKit calls playerViewController:shouldExitFullScreenWithReason in the scenario that the exit fullscreen request
+ is from the web process (e.g., through _javascript_ API videoElement.webkitExitFullscreen()).
+ We have to ignore the callback in that case.
+
+ No new tests, covered by existing tests.
+
+ * platform/ios/VideoFullscreenInterfaceAVKit.h:
+ * platform/ios/VideoFullscreenInterfaceAVKit.mm:
+ (VideoFullscreenInterfaceAVKit::exitFullscreen):
+ (VideoFullscreenInterfaceAVKit::cleanupFullscreen):
+ (VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
+ (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
+
2020-01-08 Andres Gonzalez <[email protected]>
Fix for parameterized attribute TextMarkerRangeForUIElement which should run ion main thread.
Modified: trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h (254211 => 254212)
--- trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h 2020-01-08 19:50:14 UTC (rev 254211)
+++ trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h 2020-01-08 19:56:13 UTC (rev 254212)
@@ -218,6 +218,7 @@
bool m_targetStandby { false };
bool m_waitingForPreparedToExit { false };
+ bool m_shouldIgnoreAVKitCallbackAboutExitFullscreenReason { false };
};
}
Modified: trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm (254211 => 254212)
--- trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm 2020-01-08 19:50:14 UTC (rev 254211)
+++ trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm 2020-01-08 19:56:13 UTC (rev 254212)
@@ -875,10 +875,13 @@
setInlineRect(finalRect, true);
doExitFullscreen();
+ m_shouldIgnoreAVKitCallbackAboutExitFullscreenReason = true;
}
void VideoFullscreenInterfaceAVKit::cleanupFullscreen()
{
+ m_shouldIgnoreAVKitCallbackAboutExitFullscreenReason = false;
+
LOG(Fullscreen, "VideoFullscreenInterfaceAVKit::cleanupFullscreen(%p)", this);
m_cleanupNeedsReturnVideoContentLayer = true;
@@ -1100,7 +1103,6 @@
{
LOG(Fullscreen, "VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler(%p)", this);
if (m_shouldReturnToFullscreenWhenStoppingPiP) {
-
m_shouldReturnToFullscreenWhenStoppingPiP = false;
m_restoringFullscreenForPictureInPictureStop = true;
@@ -1123,6 +1125,12 @@
bool VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason(VideoFullscreenInterfaceAVKit::ExitFullScreenReason reason)
{
+ // AVKit calls playerViewController:shouldExitFullScreenWithReason in the scenario that the exit fullscreen request
+ // is from the web process (e.g., through _javascript_ API videoElement.webkitExitFullscreen()).
+ // We have to ignore the callback in that case.
+ if (m_shouldIgnoreAVKitCallbackAboutExitFullscreenReason)
+ return true;
+
if (!m_videoFullscreenModel)
return true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes