4
votes

I have a web app that implements WebRTC using adapter.js, and most cases work. Firefox to Firefox and Chrome to Chrome work fine, but:

When Chrome and Firefox connect, the video from the Firefox side doesn't show up on the Chrome side. Audio does work!, so the webrtc channel is good.

  • Computers are in the same network
  • (I do have STUN/TURN capabilities, but that's irrelevant I think)
  • It doesn't matter which one initiates the call
  • It's always Chrome that doesn't see Firefox, Firefox always does see Chrome
  • No errors, no warnings, all expected callbacks fire, handshake seems to be done
  • Alice sends Bob her ice candidates at 'the end' of onicecandidate. Bob does the same, but timing might be more important than I realize here.
  • Both video elements are created, with a blob src (using srcObject), and onloadedmetadata fires on both browsers
  • Happens on every computer (tried ~ 20 combinations on 5 computers)

Very occasionally other things fail, like ICE negotiation (even though it's always the same network), and createOffer or setRemoteDescription sometimes fails.

All problems I can find like this are from 2-3 years ago, but after that Firefox and Chrome seem to be good RTC buddies. What's going on with my video?

Related, but not the solution:

1
when you meant "When Chrome and Firefox connect, the video from the Firefox side doesn't show up on the Chrome side." The onaddstream was not triggered?Anand S
@AnandS No, both streams exist, and onloadedmetadata is even triggered for the video that represents the stream. It's just black/empty...Rudie

1 Answers

0
votes

Likely this is a problem with assumptions about things happening synchronously or not in the API. The API is heavily asynchronous, and what happens synchronously or not varies between the browsers (or between different versions of the same browser). You may want to carefully compare your code to other examples using adapter.js.

Without the code or the relevant snippets it's hard to say exactly what is wrong, however important things to check are about:webrtc (for Firefox, including the connection log at the bottom), the chrome webrtc internals page, and internal logging. Also add your own logging of what callbacks/promises happened and didn't. I suggest in firefox setting the env vars NSPR_LOG_MODULES=signaling:4,mtransport:4 and NSPR_LOG_FILE=whatever. You can also (especially with those logs or some sample code) ping Firefox developers in #media on irc.mozilla.org.