I am able to establish WebRTC connection between Firefox and Chrome, but renegotiation between Firefox-Chrome does not work properly.
There is no problem in renegotiation between Chrome-Chrome pair and Firefox-Firefox pair.
With Firefox-Chrome pair, when I start the renegotiation from chrome after removing or adding a track, renegotiation is successful and onremovestream
or onaddstream
callbacks are triggered on firefox correctly.
But when I start the renegotiation from Firefox after removing or adding a track using pc.removeTrack
or pc.addTrack
, renegotiation was successful without any error. But in Chrome onremovestream
or onaddstream
callbacks are not triggered. When I get the MediaStream using pc.getRemoteStreams
I can see that tracks' ids are changed after renegotiation, but MediaStream does not work when I tried to play it.
One odd thing I notice is, the actual local track id from Firefox does not match with the remote track id in Chrome (even before renegotiation).
Does Chrome and Firefox support renegotiation across the browsers(mainly from firefox to chrome)?
Have anyone achieved renegotiation between firefox and Chrome?
Is there any workaround for this problem?
This is not a complete solution but the reason why this is happening. I encourage posting an solution if you find one.
There are two plans UnifiedPlan and PlanB for multiple streams in WebRTC. PlanB was dropped and UnifiedPlan is becoming the standard. Firefox implemented UnifiedPlan but chrome still has PlanB implementation. There is an Chromium Bug about this.
There was a polyfill written for this, spd-interop. But this polyfill has a limitation, it supports only renegotiation from Chrome to Firefox.
If I find a workaround for this before chrome fixes the issue, I will update the answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With