<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>235287</bug_id>
          
          <creation_ts>2022-01-16 23:00:43 -0800</creation_ts>
          <short_desc>MediaSession coordinator setTrack API not works</short_desc>
          <delta_ts>2022-01-18 08:28:16 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>Safari 15</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>macOS 12</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="cammy">cammy.tang</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>eric.carlson</cc>
    
    <cc>jer.noble</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1831404</commentid>
    <comment_count>0</comment_count>
    <who name="cammy">cammy.tang</who>
    <bug_when>2022-01-16 23:00:43 -0800</bug_when>
    <thetext>Issue:
When Shareplay between macOS safari and iOS native APP, Can&apos;t receive &quot;settrack&quot; action from native APP, also can&apos;t receive from our own website.

Sample Code in our website:
//Action handlers
 navigator.mediaSession.setActionHandler(&apos;play&apos;, () =&gt; {//work
	player.play(); 
});
navigator.mediaSession.setActionHandler(&apos;pause&apos;, () =&gt; {//work
	player.pause();
});
navigator.mediaSession.setActionHandler(&apos;settrack&apos;, (details) =&gt; {//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 &apos;setTrack&apos; to inform iOS APP to sync switch. Otherwise,if user switch on APP, we receive and handle &quot;settrack&quot; action to sync on our website.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1831685</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-01-18 08:28:16 -0800</bug_when>
    <thetext>&lt;rdar://problem/87712870&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>