Title: [174277] trunk/Source/WebCore
Revision
174277
Author
jer.no...@apple.com
Date
2014-10-03 13:07:01 -0700 (Fri, 03 Oct 2014)

Log Message

[iOS] Back-to-back fullscreen videos result in incorrectly sized videos
https://bugs.webkit.org/show_bug.cgi?id=137380

Reviewed by Eric Carlson.

During a normal workflow, a <video> element will create an AVPlayerLayer, then it will get a
fullscreen (hosted) parent layer, then it will be told an explicit fullscreen size. But when
a <video> element creates an AVPlayerLayer after the <video> element is already in
fullscreen mode, it sets that AVPlayerLayer's frame using the size of the hosted parent
layer, rather than the explicit fullscreen size. Instead, use the (already set) explicit
fullscreen size after creating the AVPlayerLayer.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::ensureAVPlayerLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (174276 => 174277)


--- trunk/Source/WebCore/ChangeLog	2014-10-03 19:58:52 UTC (rev 174276)
+++ trunk/Source/WebCore/ChangeLog	2014-10-03 20:07:01 UTC (rev 174277)
@@ -1,3 +1,21 @@
+2014-10-03  Jer Noble  <jer.no...@apple.com>
+
+        [iOS] Back-to-back fullscreen videos result in incorrectly sized videos
+        https://bugs.webkit.org/show_bug.cgi?id=137380
+
+        Reviewed by Eric Carlson.
+
+        During a normal workflow, a <video> element will create an AVPlayerLayer, then it will get a
+        fullscreen (hosted) parent layer, then it will be told an explicit fullscreen size. But when
+        a <video> element creates an AVPlayerLayer after the <video> element is already in
+        fullscreen mode, it sets that AVPlayerLayer's frame using the size of the hosted parent
+        layer, rather than the explicit fullscreen size. Instead, use the (already set) explicit
+        fullscreen size after creating the AVPlayerLayer.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::ensureAVPlayerLayer):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer):
+
 2014-10-03 Bear Travis <betra...@adobe.com>
 
         REGRESSION (r173531): Use after free in WebCore::RenderStyle::fontMetrics /

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


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2014-10-03 19:58:52 UTC (rev 174276)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2014-10-03 20:07:01 UTC (rev 174277)
@@ -608,7 +608,7 @@
     m_videoInlineLayer = adoptNS([[WebVideoContainerLayer alloc] init]);
     [m_videoInlineLayer setFrame:CGRectMake(0, 0, defaultSize.width(), defaultSize.height())];
     if (m_videoFullscreenLayer) {
-        [m_videoLayer setFrame:[m_videoFullscreenLayer bounds]];
+        [m_videoLayer setFrame:CGRectMake(0, 0, m_videoFullscreenFrame.width(), m_videoFullscreenFrame.height())];
         [m_videoFullscreenLayer insertSublayer:m_videoLayer.get() atIndex:0];
     } else {
         [m_videoInlineLayer insertSublayer:m_videoLayer.get() atIndex:0];
@@ -1021,7 +1021,7 @@
     [CATransaction setDisableActions:YES];
 
     if (m_videoFullscreenLayer && m_videoLayer) {
-        [m_videoLayer setFrame:[m_videoFullscreenLayer bounds]];
+        [m_videoLayer setFrame:CGRectMake(0, 0, m_videoFullscreenFrame.width(), m_videoFullscreenFrame.height())];
         [m_videoLayer removeFromSuperlayer];
         [m_videoFullscreenLayer insertSublayer:m_videoLayer.get() atIndex:0];
     } else if (m_videoInlineLayer && m_videoLayer) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to