<?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>195489</bug_id>
          
          <creation_ts>2019-03-08 15:41:17 -0800</creation_ts>
          <short_desc>[Safari 12.1 Beta] Adding a previously removed MediaStreamTrack does not change direction from &quot;recvonly&quot; to &quot;sendrecv&quot;</short_desc>
          <delta_ts>2019-06-10 08:59:32 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebRTC</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P1</priority>
          <bug_severity>Blocker</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Manjesh Malavalli">mmalavalli</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1514237</commentid>
    <comment_count>0</comment_count>
    <who name="Manjesh Malavalli">mmalavalli</who>
    <bug_when>2019-03-08 15:41:17 -0800</bug_when>
    <thetext>Steps to reproduce:

1. Open this JSFiddle: https://jsfiddle.net/9uk4a8b6/ in a new tab.
2. Observe the browser console.

Expected behavior:

The &quot;video&quot; m= section&apos;s direction should be &quot;sendrecv&quot;.

Actual behavior:

The &quot;video&quot; m= section&apos;s direction is &quot;recvonly&quot;.

Effect:

The remote RTCPeerConnection does not emit an RTCTrackEvent for the re-added MediaStreamTrack.

Note:

The same JSFiddle runs correctly in the current stable version of Chrome.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1514994</commentid>
    <comment_count>1</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2019-03-11 14:16:45 -0700</bug_when>
    <thetext>Hi Manjesh,

we are currently moving out plan B and going to Unified plan.
Your existing test is setting plan B, is it plan B specific?
Do you experience the same issue with unified plan?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1515012</commentid>
    <comment_count>2</comment_count>
    <who name="Manjesh Malavalli">mmalavalli</who>
    <bug_when>2019-03-11 14:42:25 -0700</bug_when>
    <thetext>Hi Youenn,

My understanding was that Safari 12.1+ will support unified plan. But I was surprised that the Safari 12.1 Beta4, on which I ran the JSFiddle was using plan b SDPs and exhibiting this behavior. I have not seen this behavior in the latest Safari Tech Preview (12.2), which does indeed support unified plan.

Can you let me know where I can get access to the latest Safari 12.1 Beta with unified plan support?

Thanks,

Manjesh</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1515013</commentid>
    <comment_count>3</comment_count>
    <who name="Manjesh Malavalli">mmalavalli</who>
    <bug_when>2019-03-11 14:49:45 -0700</bug_when>
    <thetext>Hi Youenn,

On my dev machine, Safari 12.1 uses &quot;plan-b&quot; SDPs by default and &quot;unified-plan&quot; support  has to be enabled by going to &quot;Develop&quot; &gt; &quot;Experimental features&quot;. Are you planning to make &quot;unified-plan&quot; the default in 12.1?

Thanks,

Manjesh</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1515025</commentid>
    <comment_count>4</comment_count>
    <who name="Manjesh Malavalli">mmalavalli</who>
    <bug_when>2019-03-11 15:01:28 -0700</bug_when>
    <thetext>Hi Youenn,

I created another JSFiddle: https://jsfiddle.net/0c4utdfm/ to run the same scenario with unified plan turned on. This issue is reproducible in unified plan mode as well.

Thanks,

Manjesh</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1515059</commentid>
    <comment_count>5</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2019-03-11 15:39:16 -0700</bug_when>
    <thetext>Looking more closely at the jsfiddle, it seems to be doing the following thing:
- It is adding a track. At that point, the corresponding transceiver/m-section is sendrecv 
- It is removing the track. At that point, the corresponding transceiver/m-section is made recvonly
- It is adding the same track. At that point, this creates a new transceiver/m-section for this track. The transceiver/m-section related to the removed track is not reused for the addTrack call so it stays as recvonly.

I think this matches the intended behavior.
Can you confirm this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1515067</commentid>
    <comment_count>6</comment_count>
    <who name="Manjesh Malavalli">mmalavalli</who>
    <bug_when>2019-03-11 15:53:13 -0700</bug_when>
    <thetext>Hi Yoenn,

In &quot;unified plan&quot; mode on Safari 12.1 Beta4, I compared the behavior with that of Chrome and Firefox and looks like it matches expected behavior.

However, the local copy of Safari 12.1 Beta4 that I have installed on my machine has &quot;plan-b&quot; as the default SDP format. And in &quot;plan-b&quot; mode, the &quot;video&quot; m= section does not switch back to &quot;sendrecv&quot; after re-adding the MediaStreamTrack.

Can you confirm that you will be setting &quot;unified plan&quot; as the default SDP format in Safari 12.1? It is really important to us that we know which version of Safari will support &quot;unified plan&quot; as the default SDP format as we are trying to coincide out SDK releases with Safari&apos;s rollout.

Thanks,

Manjesh</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1515129</commentid>
    <comment_count>7</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-03-11 17:28:42 -0700</bug_when>
    <thetext>&lt;rdar://problem/48790953&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1543347</commentid>
    <comment_count>8</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2019-06-10 08:59:32 -0700</bug_when>
    <thetext>Unified plan is on by default.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>