[webrtc-pc] Should / does the order of replaceTrack and direction matter?

itsthetaste has just created a new issue for https://github.com/w3c/webrtc-pc:

== Should / does the order of replaceTrack and direction matter? ==
I've been debugging an issue where in Firefox 61+ I am unable to hear the audio being sent from firefox to me other peers.

I had my code setup like in the blog @jan-ivar had posted last year, specifically the update for firefox 59, which forced me to use transcievers. https://blog.mozilla.org/webrtc/the-evolution-of-webrtc/, where by, I created an inactive transceivers;

`var audioTransceiver = RTCPeerConnection.addTransceiver("audio", { direction : 'inactive'}); `

then when wanting to send my mic, I was calling;

```
audioTransceiver.sender.replaceTrack(track);
audioTransceiver.direction = "sendonly";
```

and then negotiating.

I notice that the warm start up example (https://w3c.github.io/webrtc-pc/#advanced-peer-to-peer-example-with-warm-up) has the direction change before the replaceTrack as does the new(ish) blog post by @jan-ivar (https://blog.mozilla.org/webrtc/rtcrtptransceiver-explored/).

If I change my js to be this way around, then now, Firefox 61+ thinks my track is enabled and doesn't send silence.  But, the order doesn't seem to matter to my camera and I can get it to work either way.

So, should / does the order matter?

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/1933 using your GitHub account

Received on Friday, 13 July 2018 16:04:15 UTC