Bug 235287
| Summary: | MediaSession coordinator setTrack API not works | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | cammy <cammy.tang> |
| Component: | Media | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | eric.carlson, jer.noble, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 15 | ||
| Hardware: | Mac (Intel) | ||
| OS: | macOS 12 | ||
cammy
Issue:
When Shareplay between macOS safari and iOS native APP, Can't receive "settrack" action from native APP, also can't receive from our own website.
Sample Code in our website:
//Action handlers
navigator.mediaSession.setActionHandler('play', () => {//work
player.play();
});
navigator.mediaSession.setActionHandler('pause', () => {//work
player.pause();
});
navigator.mediaSession.setActionHandler('settrack', (details) => {//NOT work
const nextVideo = details.trackIdentifier;
playNext(nextVideo);
});
//produce setTrack action when user click next item.
navigator.mediaSession.coordinator.setTrack(playing.seoName);
Business scene:
When user switch video A to video B on Safari,we intend to produce action 'setTrack' to inform iOS APP to sync switch. Otherwise,if user switch on APP, we receive and handle "settrack" action to sync on our website.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/87712870>