Title: [166939] trunk/Source/WebCore
Revision
166939
Author
jer.no...@apple.com
Date
2014-04-08 11:22:56 -0700 (Tue, 08 Apr 2014)

Log Message

[WK2][iOS] Consecutive videos in full screen display only black
https://bugs.webkit.org/show_bug.cgi?id=131316

Reviewed by Eric Carlson.

Update the MediaPlayer's full screen attributes whenever the underlying engine changes,
not just when the engine is initially created. Also, clear the videoLayer out of the
fullscreen layer when destroying the videoLayer.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (166938 => 166939)


--- trunk/Source/WebCore/ChangeLog	2014-04-08 18:19:47 UTC (rev 166938)
+++ trunk/Source/WebCore/ChangeLog	2014-04-08 18:22:56 UTC (rev 166939)
@@ -1,3 +1,19 @@
+2014-04-07  Jer Noble  <jer.no...@apple.com>
+
+        [WK2][iOS] Consecutive videos in full screen display only black
+        https://bugs.webkit.org/show_bug.cgi?id=131316
+
+        Reviewed by Eric Carlson.
+
+        Update the MediaPlayer's full screen attributes whenever the underlying engine changes,
+        not just when the engine is initially created. Also, clear the videoLayer out of the
+        fullscreen layer when destroying the videoLayer.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::parseAttribute):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
+
 2014-04-08  Morten Stenshorne  <msten...@opera.com>
 
         [New Multicolumn] Child top margin sometimes ignored for column balancing

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (166938 => 166939)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2014-04-08 18:19:47 UTC (rev 166938)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2014-04-08 18:22:56 UTC (rev 166939)
@@ -4230,6 +4230,14 @@
 #if ENABLE(MEDIA_SOURCE)
     m_droppedVideoFrames = 0;
 #endif
+
+#if PLATFORM(IOS)
+    if (!m_player)
+        return;
+    m_player->setVideoFullscreenFrame(m_videoFullscreenFrame);
+    m_player->setVideoFullscreenGravity(m_videoFullscreenGravity);
+    m_player->setVideoFullscreenLayer(m_videoFullscreenLayer.get());
+#endif
 }
 
 void HTMLMediaElement::mediaPlayerFirstVideoFrameAvailable(MediaPlayer*)
@@ -5505,12 +5513,6 @@
         enqueuePlaybackTargetAvailabilityChangedEvent(); // Ensure the event listener gets at least one event.
     }
 #endif
-    
-#if PLATFORM(IOS)
-    m_player->setVideoFullscreenFrame(m_videoFullscreenFrame);
-    m_player->setVideoFullscreenGravity(m_videoFullscreenGravity);
-    m_player->setVideoFullscreenLayer(m_videoFullscreenLayer.get());
-#endif
 }
 
 #if ENABLE(WEB_AUDIO)

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (166938 => 166939)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2014-04-08 18:19:47 UTC (rev 166938)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2014-04-08 18:22:56 UTC (rev 166939)
@@ -533,6 +533,11 @@
 
     [m_videoLayer.get() setPlayer:nil];
 
+#if PLATFORM(IOS)
+    if (m_videoFullscreenLayer)
+        [m_videoLayer removeFromSuperlayer];
+#endif
+
     m_videoLayer = 0;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to