Bug 235287 - MediaSession coordinator setTrack API not works
Summary: MediaSession coordinator setTrack API not works
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari 15
Hardware: Mac (Intel) macOS 12
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-16 23:00 PST by cammy
Modified: 2022-01-18 08:28 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>