Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7067ca63e9135059e8f2acd3f6e791a1c2e576c6
https://github.com/WebKit/WebKit/commit/7067ca63e9135059e8f2acd3f6e791a1c2e576c6
Author: Jean-Yves Avenard <[email protected]>
Date: 2026-09-03 (Thu, 03 Sep 2026)
Changed paths:
M Source/WebCore/html/HTMLMediaElement.cpp
M Source/WebCore/html/HTMLMediaElement.h
M Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h
M Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm
M Source/WebCore/platform/graphics/MediaPlayerPrivate.h
M Source/WebCore/platform/graphics/MediaSourcePrivate.cpp
M Source/WebCore/platform/graphics/MediaSourcePrivate.h
M
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
M
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
M
Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp
M
Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h
M Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp
M Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm
M Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h
M Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm
M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
A Tools/TestWebKitAPI/Resources/cocoa/mse-seekable-ranges.html
M Tools/TestWebKitAPI/SourcesCocoa.txt
A
Tools/TestWebKitAPI/Tests/WebKit/WKWebView/PlaybackSessionSeekableRanges.mm
Log Message:
-----------
[visionOS] Enter Exit Spatial Browsing switching videos leads to Greyed Out
Playback UI
https://bugs.webkit.org/show_bug.cgi?id=323206
rdar://183164198
Reviewed by Jer Noble.
Setting the duration became asynchronous once the MediaSourcePrivate was made
to run in its own WorkQueue, so the UI process used the initial duration (NaN)
to calculate the range and that set canSeek = NO for AVKit.
>From that point the calculated seekable range was stale and stayed empty.
If the UI process got the updated duration on time, then seekable range was
updated properly and canSeek was set to YES ; the controls showed.
The main point of failure was that the PlaybackSessionModelMediaElement
listened to the HTMLMediaElement's progressEvent update its seekable range
and notify the UI process with the new range.
Since moving the MediaPlayerPrivateMediaSourceAVFObjC to the web content
process,
we do not fire the progress event anymore and so seekableRangesChanged was
never called and the cached seekable range in the UI process stayed stale.
We stop relying on the progress event, instead we add a new
seekableRangesFromMediaSourceChanged()
callback where the MediaPlayerPrivate can notify the seekable range has changed
and which in turns notifies the PlaybackSessionModelMediaElement via
seekableRangesChanged().
Added API test and manually verified on device.
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerSeekableTimeRangesChanged):
(WebCore::HTMLMediaElement::addClient):
(WebCore::HTMLMediaElement::seekableRangesChanged):
* Source/WebCore/html/HTMLMediaElement.h:
(WebCore::HTMLMediaElementClient::seekableRangesChanged):
* Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h:
* Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::setMediaElement):
(WebCore::PlaybackSessionModelMediaElement::updateForEventName):
(WebCore::PlaybackSessionModelMediaElement::addClient):
(WebCore::PlaybackSessionModelMediaElement::seekableRangesChanged):
(WebCore::PlaybackSessionModelMediaElement::updateSeekableRanges):
* Source/WebCore/platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::seekableRangesFromMediaSourceChanged):
* Source/WebCore/platform/graphics/MediaSourcePrivate.cpp:
(WebCore::MediaSourcePrivate::durationChanged):
(WebCore::MediaSourcePrivate::bufferedChanged):
(WebCore::MediaSourcePrivate::notifySeekableRangesChanged):
(WebCore::MediaSourcePrivate::setLiveSeekableRange):
(WebCore::MediaSourcePrivate::clearLiveSeekableRange):
* Source/WebCore/platform/graphics/MediaSourcePrivate.h:
*
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
*
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekableRangesFromMediaSourceChanged):
*
Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::seekableRangesFromMediaSourceChanged):
*
Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
* Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::seekableRangesFromMediaSourceChanged):
* Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm:
(-[WKWebView _maximumSeekableTime]):
* Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
* Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionManagerProxy::seekableRanges):
* Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::updateCachedState):
Canonical link: https://commits.webkit.org/320425@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications