RESOLVED FIXED 229068
nexttrack and previoustrack MediaSession handlers not working
https://bugs.webkit.org/show_bug.cgi?id=229068
Summary nexttrack and previoustrack MediaSession handlers not working
Jean-Yves Avenard [:jya]
Reported 2021-08-12 20:54:17 PDT
nexttrack and previoustrack MediaSession handlers not working
Attachments
Patch (2.29 KB, patch)
2021-08-12 21:18 PDT, Jean-Yves Avenard [:jya]
no flags
Jean-Yves Avenard [:jya]
Comment 1 2021-08-12 20:55:38 PDT
Jean-Yves Avenard [:jya]
Comment 2 2021-08-12 21:18:13 PDT
youenn fablet
Comment 3 2021-08-13 00:07:39 PDT
Comment on attachment 435471 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=435471&action=review > Source/WebCore/ChangeLog:12 > + used with the MediaRemote backend, which prevents automating the test. Could we do the following: - Use MediaSession API to trigger adding handlers for nexttrack. - Add an Internals.idl API to get the supported commands, which would generate a string. Validate 'nexttrack' is in the commands? Another approach would be to add a mock backend, which sounds feasible as well.
Jean-Yves Avenard [:jya]
Comment 4 2021-08-13 01:36:35 PDT
Comment on attachment 435471 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=435471&action=review >> Source/WebCore/ChangeLog:12 >> + used with the MediaRemote backend, which prevents automating the test. > > Could we do the following: > - Use MediaSession API to trigger adding handlers for nexttrack. > - Add an Internals.idl API to get the supported commands, which would generate a string. Validate 'nexttrack' is in the commands? > > Another approach would be to add a mock backend, which sounds feasible as well. What this bug caused was that if you registered a nexttrack action handler it would have registered the MR previous track message that makes Now Playing display the wrong button. This was the only thing wrong. If you had pressed the previous button, it would have correctly called the previoustrack handler. The mapping from MR to MediaSession is correct. If we had a test, all we would test is the test itself, there would be no guarantee that if that test pass the right information would reach MR.
youenn fablet
Comment 5 2021-08-13 01:45:40 PDT
> If we had a test, all we would test is the test itself, there would be no > guarantee that if that test pass the right information would reach MR. It depends how you implement the Internals API (it would need to get the information from the MR) or how you implement the mock (it would need to replace the session manager nowPlaying manager and then query what the mock is receiving, should not be too difficult with mock in web process, but harder in GPU process).
Jean-Yves Avenard [:jya]
Comment 6 2021-08-13 04:33:42 PDT
I will take this in another bug. The scope to implement such test will be way more difficult than the fix itself
EWS
Comment 7 2021-08-13 04:57:28 PDT
Committed r281013 (240503@main): <https://commits.webkit.org/240503@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 435471 [details].
Eric Carlson
Comment 8 2021-08-13 08:50:26 PDT
Comment on attachment 435471 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=435471&action=review >>> Source/WebCore/ChangeLog:12 >>> + used with the MediaRemote backend, which prevents automating the test. >> >> Could we do the following: >> - Use MediaSession API to trigger adding handlers for nexttrack. >> - Add an Internals.idl API to get the supported commands, which would generate a string. Validate 'nexttrack' is in the commands? >> >> Another approach would be to add a mock backend, which sounds feasible as well. > > What this bug caused was that if you registered a nexttrack action handler it would have registered the MR previous track message that makes Now Playing display the wrong button. > > This was the only thing wrong. If you had pressed the previous button, it would have correctly called the previoustrack handler. The mapping from MR to MediaSession is correct. > > If we had a test, all we would test is the test itself, there would be no guarantee that if that test pass the right information would reach MR. Making this testable could be as simple as adding `PlatformMediaSessionManager::getSupportedCommands()`, plumbing it down to `RemoteCommandListener`, and exposing that through Internals.idl.
Aakash Jain
Comment 9 2021-08-13 14:09:56 PDT
WebKit Commit Bot
Comment 10 2021-08-13 14:10:36 PDT
Re-opened since this is blocked by bug 229096
Aakash Jain
Comment 11 2021-08-13 14:17:48 PDT
Commented on wrong bug, please ignore.
Note You need to log in before you can comment on or make changes to this bug.