Bug 235287

Summary: MediaSession coordinator setTrack API not works
Product: WebKit Reporter: cammy <cammy.tang>
Component: MediaAssignee: 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   

Description cammy 2022-01-16 23:00:43 PST
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.
Comment 1 Radar WebKit Bug Importer 2022-01-18 08:28:16 PST
<rdar://problem/87712870>