[iOS] Abrupt transition between Fullscreen -> PiP
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Dec 2015 23:53:03 +0000 (23:53 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Dec 2015 23:53:03 +0000 (23:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=151719

Reviewed by Eric Carlson.

Rather than abruptly hiding the fullscreen window, explicitly exit fullscreen mode upon entering PiP.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192922 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm

index 6f03f88..04dd35c 100644 (file)
@@ -1,3 +1,15 @@
+2015-12-01  Jer Noble  <jer.noble@apple.com>
+
+        [iOS] Abrupt transition between Fullscreen -> PiP
+        https://bugs.webkit.org/show_bug.cgi?id=151719
+
+        Reviewed by Eric Carlson.
+
+        Rather than abruptly hiding the fullscreen window, explicitly exit fullscreen mode upon entering PiP.
+
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+        (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture):
+
 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Give String and AtomicString an existingHash() function
index def4ae5..9c97884 100644 (file)
@@ -1325,8 +1325,16 @@ void WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture()
 {
     LOG(Fullscreen, "WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture(%p)", this);
     [m_playerViewController setShowsPlaybackControls:YES];
-    [m_window setHidden:YES];
-    [[m_playerViewController view] setHidden:YES];
+
+    if (m_mode & HTMLMediaElementEnums::VideoFullscreenModeStandard) {
+        clearMode(HTMLMediaElementEnums::VideoFullscreenModeStandard);
+
+        RefPtr<WebVideoFullscreenInterfaceAVKit> strongThis(this);
+        [m_playerViewController exitFullScreenAnimated:YES completionHandler:[strongThis, this] (BOOL, NSError*) {
+            [m_window setHidden:YES];
+            [[m_playerViewController view] setHidden:YES];
+        }];
+    }
 
     if (m_fullscreenChangeObserver)
         m_fullscreenChangeObserver->didEnterFullscreen();