HTMLMediaElement should not remove the media session at DOM suspension time
<rdar://problem/58800787>
Created attachment 388539 [details] Patch
Comment on attachment 388539 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=388539&action=review > Source/WebCore/ChangeLog:16 > + Partially revert the behavior by calling the same code as clientWiillPausePlayback but make sure updateNowPlayingInfo is calling asynchronously when suspending the media element. s/clientWiillPausePlayback/clientWillPausePlayback/ Also, this line is really long. > Source/WebCore/html/HTMLMediaElement.cpp:2331 > + queueTaskKeepingObjectAlive(*this, TaskSource::Networking, [this] { Why not TaskSource::MediaElement? > Source/WebCore/platform/audio/PlatformMediaSession.cpp:253 > + bool shouldDelayCallingUpdateNowPlaying = false; > + return processClientWillPausePlayback(shouldDelayCallingUpdateNowPlaying); > +} > + > +void PlatformMediaSession::clientWillBeDOMSuspended() > +{ > + bool shouldDelayCallingUpdateNowPlaying = true; > + processClientWillPausePlayback(shouldDelayCallingUpdateNowPlaying); Why not pass a PlatformMediaSessionManager::DelayCallingUpdateNowPlaying instead of a bool? Or maybe define the enum in this class and use it in PlatformMediaSessionManager
Created attachment 388656 [details] Patch
Created attachment 388699 [details] Patch
Thanks for the review Eric, I took it all! As of iOS failure, this is due to the test simulating scrolling but waiting for an event while scrolling. Given scrolling is suspending DOM objects, events cannot really happen during that time. I updated the test accordingly.
Comment on attachment 388699 [details] Patch Clearing flags on attachment: 388699 Committed r255116: <https://trac.webkit.org/changeset/255116>
All reviewed patches have been landed. Closing bug.
*** Bug 206760 has been marked as a duplicate of this bug. ***