[webkit-changes] [WebKit/WebKit] 68f1d5: [iOS] Videos do not enter fullscreen on trailers.a...

Jer Noble noreply at github.com
Thu Jun 15 12:05:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 68f1d51e13e7c9ab14983aab00b1de69681a2458
      https://github.com/WebKit/WebKit/commit/68f1d51e13e7c9ab14983aab00b1de69681a2458
  Author: Jer Noble <jer.noble at apple.com>
  Date:   2023-06-15 (Thu, 15 Jun 2023)

  Changed paths:
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/html/HTMLMediaElement.h
    M Source/WebCore/platform/graphics/MediaPlayer.cpp
    M Source/WebCore/platform/graphics/MediaPlayer.h
    M Source/WebCore/platform/graphics/MediaPlayerPrivate.h
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in
    M Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm
    M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
    M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h
    M Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm

  Log Message:
  -----------
  [iOS] Videos do not enter fullscreen on trailers.apple.com
https://bugs.webkit.org/show_bug.cgi?id=258061
rdar://108332808

Reviewed by Eric Carlson.

On trailers.apple.com, the page begins playing a video without `playinline` and with
a `visibility:hidden` CSS rule. This starts a race as to whether the video will
sufficently set up rendering before loading enough media data to send the `canplay`
event. If the latter happens first, entering fullscreen will fail, because
VideoFullscreenManager does not have the LayerHostingContextID necessary to remotely
host the video content.

This patch adds a new method to HTMLMediaElement/MediaPlayer/MediaPlayerPrivate and
the WebKit classes MediaPlayerPrivateRemote/RemoteMediaPlayerProxy, requestHostingContextID(),
which takes a callback which will return the LayerHostingContextID once it changes.
When that happens, entering fullscreen will continue apace.

* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::requestHostingContextID):
* Source/WebCore/html/HTMLMediaElement.h:
* Source/WebCore/platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::requestHostingContextID):
* Source/WebCore/platform/graphics/MediaPlayer.h:
* Source/WebCore/platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::requestHostingContextID):
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::~RemoteMediaPlayerProxy):
(WebKit::RemoteMediaPlayerProxy::requestHostingContextID):
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h:
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
* Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
(WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged):
(WebKit::RemoteMediaPlayerProxy::requestHostingContextID):
* Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::~MediaPlayerPrivateRemote):
(WebKit::MediaPlayerPrivateRemote::requestHostingContextID):
(WebKit::MediaPlayerPrivateRemote::setLayerHostingContextID):
* Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
* Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):

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




More information about the webkit-changes mailing list