Title: [293347] branches/safari-613.2.7.1-branch/Source/WebCore
Revision
293347
Author
alanc...@apple.com
Date
2022-04-25 13:52:15 -0700 (Mon, 25 Apr 2022)

Log Message

Cherry-pick r292430. rdar://problem/92204558

    [Cocoa] Video is sometimes not visible after r292049
    https://bugs.webkit.org/show_bug.cgi?id=238826

    Reviewed by Jer Noble.

    RenderVideo::willBeDestroyed calls MediaPlayer::setPageIsVisible, which causes
    MediaPlayerPrivateAVFoundationObjC::platformSetVisible to hide the AVPlayerLayer.
    HTMLMediaElement::visibilityStateChanged is the only other thing that calls
    MediaPlayer::setPageIsVisible, and it only calls it when the page visibility changes,
    so if that doesn't happen the AVPlayerLayer is not shown when the renderer is
    recreated.

    * rendering/RenderVideo.cpp:
    (WebCore::RenderVideo::willBeDestroyed): Don't call MediaPlayer::setPageIsVisible(false),
    the page visibility has not changed.

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

Modified Paths

Diff

Modified: branches/safari-613.2.7.1-branch/Source/WebCore/ChangeLog (293346 => 293347)


--- branches/safari-613.2.7.1-branch/Source/WebCore/ChangeLog	2022-04-25 20:52:11 UTC (rev 293346)
+++ branches/safari-613.2.7.1-branch/Source/WebCore/ChangeLog	2022-04-25 20:52:15 UTC (rev 293347)
@@ -1,5 +1,46 @@
 2022-04-25  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r292430. rdar://problem/92204558
+
+    [Cocoa] Video is sometimes not visible after r292049
+    https://bugs.webkit.org/show_bug.cgi?id=238826
+    
+    Reviewed by Jer Noble.
+    
+    RenderVideo::willBeDestroyed calls MediaPlayer::setPageIsVisible, which causes
+    MediaPlayerPrivateAVFoundationObjC::platformSetVisible to hide the AVPlayerLayer.
+    HTMLMediaElement::visibilityStateChanged is the only other thing that calls
+    MediaPlayer::setPageIsVisible, and it only calls it when the page visibility changes,
+    so if that doesn't happen the AVPlayerLayer is not shown when the renderer is
+    recreated.
+    
+    * rendering/RenderVideo.cpp:
+    (WebCore::RenderVideo::willBeDestroyed): Don't call MediaPlayer::setPageIsVisible(false),
+    the page visibility has not changed.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-04-05  Eric Carlson  <eric.carl...@apple.com>
+
+            [Cocoa] Video is sometimes not visible after r292049
+            https://bugs.webkit.org/show_bug.cgi?id=238826
+
+            Reviewed by Jer Noble.
+
+            RenderVideo::willBeDestroyed calls MediaPlayer::setPageIsVisible, which causes
+            MediaPlayerPrivateAVFoundationObjC::platformSetVisible to hide the AVPlayerLayer.
+            HTMLMediaElement::visibilityStateChanged is the only other thing that calls
+            MediaPlayer::setPageIsVisible, and it only calls it when the page visibility changes,
+            so if that doesn't happen the AVPlayerLayer is not shown when the renderer is
+            recreated.
+
+            * rendering/RenderVideo.cpp:
+            (WebCore::RenderVideo::willBeDestroyed): Don't call MediaPlayer::setPageIsVisible(false),
+            the page visibility has not changed.
+
+2022-04-25  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r293286. rdar://problem/92198272
 
     Crash under AsyncScrollingCoordinator::scrollingThreadAddedPendingUpdate()

Modified: branches/safari-613.2.7.1-branch/Source/WebCore/rendering/RenderVideo.cpp (293346 => 293347)


--- branches/safari-613.2.7.1-branch/Source/WebCore/rendering/RenderVideo.cpp	2022-04-25 20:52:11 UTC (rev 293346)
+++ branches/safari-613.2.7.1-branch/Source/WebCore/rendering/RenderVideo.cpp	2022-04-25 20:52:15 UTC (rev 293347)
@@ -65,16 +65,6 @@
 void RenderVideo::willBeDestroyed()
 {
     visibleInViewportStateChanged();
-
-#if ENABLE(VIDEO_PRESENTATION_MODE)
-    auto player = videoElement().player();
-    if (player && videoElement().webkitPresentationMode() != HTMLVideoElement::VideoPresentationMode::PictureInPicture)
-        player->setPageIsVisible(false);
-#else
-    if (auto player = videoElement().player())
-        player->setPageIsVisible(false);
-#endif
-
     RenderMedia::willBeDestroyed();
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to