/ WebKit Public
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A HTMLMediaElement created while page is interrupted should be able t…
…o autoplay https://bugs.webkit.org/show_bug.cgi?id=241783 Patch by Youenn Fablet <email@example.com> on 2022-06-21 Reviewed by Eric Carlson. Previously, a session created while manager is interrupted would get its state set to interrupted. When end of interruption happens, it would not be restarted since its interruption count would be set to 0. Instead, manager now stores the last interruption. In case of a new session, we now call beginInterruption instead of setting the session state directly. This allows to have an interruption count set to 1 and thus uninterrupt the session when the end of interruption signal happens. Covered by added test. * LayoutTests/fast/mediastream/video-created-while-interrupted-expected.txt: Added. * LayoutTests/fast/mediastream/video-created-while-interrupted.html: Added. * Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::beginInterruption): (WebCore::PlatformMediaSessionManager::endInterruption): (WebCore::PlatformMediaSessionManager::addSession): (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback): (WebCore::PlatformMediaSessionManager::processSystemWillSleep): (WebCore::PlatformMediaSessionManager::processSystemDidWake): * Source/WebCore/platform/audio/PlatformMediaSessionManager.h: (WebCore::PlatformMediaSessionManager::isInterrupted const): Canonical link: https://commits.webkit.org/251691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing 4 changed files with 43 additions and 9 deletions.