Currently the Now Playing content is updated when the PlatformMediaSessionManager (MediaSessionManagerCocoa) requests from the PlatformMediaSession (MediaElementSession).
The PlatformMediaSession will retrieve the Media Session metadata and then pass it on.
When the Media Session metadata gets updated (like after retrieving the image data), for the PlatformMediaSessionManager to refresh the Now Playing content, the user must interact with the media element (such as seeking, changing the focus of the window, pausing the video etc).
If no such interaction is to occur, then the Now Playing will show stale data.
We need to notify the PlatformMediaSession that the Metadata got updated and refresh the Now Playing content.
Bug 222158 introduced a mechanism to set observer of the Metadata content. We will use it to fix this bug.
Additionally, by implementing the Media Session observer it will allow to set default action when a Media Session handler isn't defined.
Created attachment 424345 [details]
Created attachment 424346 [details]
Issue with forward declaration and Optional, changing method prototype to use reference instead
Created attachment 424347 [details]
Fix unresolved symbol on TVOS
Comment on attachment 424345 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=424345&action=review
> + session->removeObserver(*m_observer);
You could give MediaSessionObserver a pointer to the media session and have it call add/removeObserver automatically
Created attachment 424521 [details]
Comment on attachment 424521 [details]
I'm afraid this will need to be rebased.
Created attachment 424611 [details]
Comment on attachment 424611 [details]
unrelated iPhoto.Framework failure.
Committed r275203: <https://commits.webkit.org/r275203>
All reviewed patches have been landed. Closing bug and clearing flags on attachment 424611 [details].