Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 8af96a4282c7692ee93b925fdc5d731d8c250deb https://github.com/WebKit/WebKit/commit/8af96a4282c7692ee93b925fdc5d731d8c250deb Author: Jean-Yves Avenard <j...@apple.com> Date: 2025-08-21 (Thu, 21 Aug 2025)
Changed paths: M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm M Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm M Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.h M Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm Log Message: ----------- Netflix Video Briefly Disappears and Reappears When Entering Docked Spatial Web View https://bugs.webkit.org/show_bug.cgi?id=297448 rdar://158557448 Reviewed by Jer Noble. Following-up on 298745@main; we now adopt VideoMediaSampleRenderer::changeRenderer in the MediaPlayerPrivateMediaSourceAVFObjC. It allows for almost flawless change from fullscreen to docking on visionOS devices. For the code to be effective, we need to enable the VideoRendererUseDecompressionSessionForProtected preference on visionOS so that the VideoMediaSampleRenderer has detailed knowledge of all video frames decoded. Covered by existing tests and manually tested on a Vision Pro The following scenarios were tested with YouTube and Netflix: Enter fullscreen, enter dock mode, exit dock mode, repeat. Enter fullscreen, enter dock mode, let multiple videos play, exit dock mode, repeat. When an ad is playing, enter fullscreen, enter dock mode, exit dock mode, repeat. When an ad is playing, enter fullscreen, enter dock mode, wait for the next video to play, exit dock mode, repeat. * Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyVideoLayerIfNeeded): As the change from AVSBDL to AVSBVR is now instantaneous, we must delay the call to VideoLayerManagerObjC::didDestroyVideoLayer to prevent a rapid black flicker when we transition to the AVSBVR and before it entered into fullscreen. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureRenderlessVideoMediaSampleRenderer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayerOrVideoRendererWithDecompressionSession): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayerOrVideoRenderer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoRenderer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::stageVideoRenderer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::canUseDecompressionSession const): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isUsingDecompressionSession const): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::layerOrVideoRenderer const): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoTarget): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isInFullscreenOrPictureInPictureChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::maybeUpdateDisplayLayer): * Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::setVideoRenderer): * Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.h: * Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm: (WebCore::MediaPlayerPrivateWebM::destroyVideoLayerIfNeeded): (WebCore::MediaPlayerPrivateWebM::ensureLayer): (WebCore::MediaPlayerPrivateWebM::destroyLayer): (WebCore::MediaPlayerPrivateWebM::stageVideoRenderer): (WebCore::MediaPlayerPrivateWebM::isInFullscreenOrPictureInPictureChanged): Remove the AVSBDL from its superview once we've been notified that the AVSBVR has completed its transition to fullscreen. Canonical link: https://commits.webkit.org/299043@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes