Skip to content

[macOS] Unable to pause video playback in PiP mode#46718

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
jernoble:eng/macOS-Unable-to-pause-video-playback-in-PiP-mode
Jun 14, 2025
Merged

[macOS] Unable to pause video playback in PiP mode#46718
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
jernoble:eng/macOS-Unable-to-pause-video-playback-in-PiP-mode

Conversation

@jernoble
Copy link
Contributor

@jernoble jernoble commented Jun 13, 2025

f3a0304

[macOS] Unable to pause video playback in PiP mode
rdar://152192112
https://bugs.webkit.org/show_bug.cgi?id=294449

Reviewed by Eric Carlson.

From logging, it appears that the playback state of the WebContent process is becoming
out-of-sync with the cached playback state in the UIProcess. Without knowing exactly how
this synchronization failed, work around the issue by explicitly updating the cached
playback state whenever a play() or pause() command is issued by the UIProcess.

* Source/WebCore/platform/cocoa/PlaybackSessionModel.h:
(WTF::LogArgument<OptionSet<WebCore::PlaybackSessionModel::PlaybackState>>::toString):
* Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h:
* Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::updateForEventName):
(WebCore::PlaybackSessionModelMediaElement::play):
(WebCore::PlaybackSessionModelMediaElement::pause):
(WebCore::PlaybackSessionModelMediaElement::updateRate):
* Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.mm:
(WebCore::PlaybackSessionInterfaceMac::rateChanged):
* Source/WebCore/platform/mac/VideoPresentationInterfaceMac.mm:
(WebCore::VideoPresentationInterfaceMac::rateChanged):

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

4486277

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@jernoble jernoble self-assigned this Jun 13, 2025
@jernoble jernoble added the Media Bugs related to the HTML 5 Media elements. label Jun 13, 2025
@webkit-early-warning-system
Copy link
Collaborator

Starting EWS tests for 4486277. Live statuses available at the PR page, #46718

@jernoble jernoble requested a review from a team June 13, 2025 20:48
@jernoble jernoble added the merge-queue Applied to send a pull request to merge-queue label Jun 14, 2025
rdar://152192112
https://bugs.webkit.org/show_bug.cgi?id=294449

Reviewed by Eric Carlson.

From logging, it appears that the playback state of the WebContent process is becoming
out-of-sync with the cached playback state in the UIProcess. Without knowing exactly how
this synchronization failed, work around the issue by explicitly updating the cached
playback state whenever a play() or pause() command is issued by the UIProcess.

* Source/WebCore/platform/cocoa/PlaybackSessionModel.h:
(WTF::LogArgument<OptionSet<WebCore::PlaybackSessionModel::PlaybackState>>::toString):
* Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h:
* Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::updateForEventName):
(WebCore::PlaybackSessionModelMediaElement::play):
(WebCore::PlaybackSessionModelMediaElement::pause):
(WebCore::PlaybackSessionModelMediaElement::updateRate):
* Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.mm:
(WebCore::PlaybackSessionInterfaceMac::rateChanged):
* Source/WebCore/platform/mac/VideoPresentationInterfaceMac.mm:
(WebCore::VideoPresentationInterfaceMac::rateChanged):

Canonical link: https://commits.webkit.org/296219@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/macOS-Unable-to-pause-video-playback-in-PiP-mode branch from 4486277 to f3a0304 Compare June 14, 2025 03:47
@webkit-commit-queue
Copy link
Collaborator

Committed 296219@main (f3a0304): https://commits.webkit.org/296219@main

Reviewed commits have been landed. Closing PR #46718 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit f3a0304 into WebKit:main Jun 14, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Media Bugs related to the HTML 5 Media elements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants