Bug 222405 - Now Playing is not working when GPUP Media is enabled
Summary: Now Playing is not working when GPUP Media is enabled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-24 22:27 PST by Jean-Yves Avenard [:jya]
Modified: 2021-03-01 15:15 PST (History)
3 users (show)

See Also:


Attachments
Patch (2.01 KB, patch)
2021-02-24 23:58 PST, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff
Patch (2.00 KB, patch)
2021-02-25 16:18 PST, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff
Patch (1.99 KB, patch)
2021-02-25 16:21 PST, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff
Patch for landing (1.33 KB, patch)
2021-03-01 14:21 PST, Michael Catanzaro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2021-02-24 22:27:53 PST
Now Playing is not working when GPUP Media is enabled
Comment 1 Jean-Yves Avenard [:jya] 2021-02-24 23:58:46 PST
Created attachment 421506 [details]
Patch
Comment 2 Eric Carlson 2021-02-25 09:06:56 PST
Comment on attachment 421506 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=421506&action=review

> Source/WebCore/ChangeLog:16
> +        MediaSessionManagerCocoa::setNowPlayingInfo would have always been called
> +        with false (setAsNowPlayingApplication) when the GPU process was in use.
> +        It needed to be called at least once.
> +        MRMediaRemoteSetCanBeNowPlayingApplication is fairly CPU intensive, so we
> +        ensure we only call it if no content had been played before and never again.

This comment isn't quite accurate because we will need to call `MRMediaRemoteSetCanBeNowPlayingApplication(true)` again if we want to become the NowPlaying application after having called `MRMediaRemoteSetCanBeNowPlayingApplication(false)`. 

Your code change works because we clear `m_nowPlayingInfo` if we call `MRMediaRemoteSetCanBeNowPlayingApplication(false)`, so I think only the comment needs too be updated.
Comment 3 Jean-Yves Avenard [:jya] 2021-02-25 16:18:43 PST
Created attachment 421582 [details]
Patch
Comment 4 Jean-Yves Avenard [:jya] 2021-02-25 16:21:10 PST
Created attachment 421583 [details]
Patch
Comment 5 EWS 2021-02-25 17:53:41 PST
Committed r273523: <https://commits.webkit.org/r273523>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421583 [details].
Comment 6 Radar WebKit Bug Importer 2021-02-25 17:54:15 PST
<rdar://problem/74769938>
Comment 7 Michael Catanzaro 2021-03-01 14:21:15 PST
Reopening to attach new patch.
Comment 8 Michael Catanzaro 2021-03-01 14:21:17 PST
Created attachment 421867 [details]
Patch for landing
Comment 9 EWS 2021-03-01 15:15:31 PST
Committed r273697: <https://commits.webkit.org/r273697>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421867 [details].