[webkit-changes] [WebKit/WebKit] e64627: REGRESSION(260774 at main): [iPad] Video turns black ...

Jer Noble noreply at github.com
Fri Mar 3 08:12:31 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e64627c9a4d48063a2c59af1f39fdb0195fc83cf
      https://github.com/WebKit/WebKit/commit/e64627c9a4d48063a2c59af1f39fdb0195fc83cf
  Author: Jer Noble <jer.noble at apple.com>
  Date:   2023-03-03 (Fri, 03 Mar 2023)

  Changed paths:
    M Source/WebCore/platform/cocoa/VideoFullscreenChangeObserver.h
    M Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm
    M Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
    M Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.h
    M Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm

  Log Message:
  -----------
  REGRESSION(260774 at main): [iPad] Video turns black after entering element fullscreen
https://bugs.webkit.org/show_bug.cgi?id=253225
rdar://105990736

Reviewed by Tim Horton.

Prior to "no-double-layer-hosting", the fullscreen machinery would create an AVPlayerLayerView and AVPlayerLayerViewController
simply to handle the case where the user might exit _element_ fullscreen when playing a video, and that video may need to
immediately enter picture-in-picture mode. As part of that process, the new AVPlayerLayerView would "steal" the video
content from an existing layer. This wasn't a problem in the double layer hosting world; there wasn't anything to steal then,
as the video layer being stolen was empty.

However, in the "no-double-layer-hosting" world, stealing the video layer results in no video being visible in the WKWebView,
as that video layer is the one inserted into the UI-side compositing tree. This code could benefit from a complete re-write,
now that there's a pre-existing AVPlayerLayerView in the web compositing hierarchy. For now, simply work around the problem
by not stealing the video layer prematurely, and by notifying the VideoFullscreenManagerProxy when PiP has ended and the
video layer can be returned to its rightful owner.

* Source/WebCore/platform/cocoa/VideoFullscreenChangeObserver.h:
* Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::doSetup):
(VideoFullscreenInterfaceAVKit::returnToStandby):
* Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm:
* Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenModelContext::returnToStandby):
(WebKit::VideoFullscreenManagerProxy::returnToStandby):

Canonical link: https://commits.webkit.org/261143@main




More information about the webkit-changes mailing list