Porting WebRTC from Chrome to Firefox Aurora

The quick brown Firefox Aurora jumped over the lazy Chrome (at least as far as Opus support is concerned)!
 

Here’s a quick update from Drum on some of the issues we’ve had porting WebRTC from Chrome to Firefox Aurora.
Up until now we have concentrated our WebRTC efforts on the Chrome browser from Google. This is primarily because it was the first to support WebRTC and is, if you avoid Canary, a stable product.
But, we are keen to investigate the Opus codec and see how that behaves with Drum. Despite it being mandated as a requirement for WebRTC Opus has not yet been added to Chrome. However, Mozilla has recently added Opus support to the nightly build of Firefox – Aurora. Since we’ll have to support multiple browsers at some point it makes sense to start now!!
I just thought that I’d list some of the pitfalls that I encountered while attempting to migrate my client side Javascript from Chrome to Firefox Aurora (version 18.0a2):

  1.  The API calls (eg. GetUserMedia) have different prefixes. In Chrome they are webkitGetUserMedia while in Firefox it is called mozGetUserMedia. The arguments to the methods are identical in each browser. A lightweight shim surrounding these functions quickly sorts this one out.
  2. The Javascript engine within Firefox (JagerMonkey) is a lot stricter than the engine within Chrome (V8). My client-side scripts showed up errors accessing unknown object member which Chrome never complained about. Of course, Firefox never actually output anything as useful as a log message!
  3. When initiating an audio-only connection a browser re-start was required before a subsequent attempt could be made. This issue had already been raised as Bug 773646.
  4. The candidates generated by Firefox are included in the Offer presented to the Javascript. The onicecandidates callback is never invoked. This is reminiscent of the old ROAP interface!
  5. The PeerConnection method calls that are marked as TODO (eg. onconnecting and onopen) in the WebRTC spec are not implemented in Firefox Aurora. In Chrome these have some code behind them. Simply ignoring them if they weren’t defined seemed to work OK!

At this point I had the signalling up and running.   Now I’ve just got to figure out why the media isn’t working. It’s probably down to the STUN negotiation (it normally is!).
I hope that my observations are useful to others attempting a similar project. Please feel free to add comments or questions and I’ll answer as best I can.
 
Dr Richard Screene is a Senior WebRTC Developer at Drum.  Richard has over 20 years experience of development for communication protocols.  He is currently responsible for integrating the Drum web and audio conferencing products using WebRTC.
Richard has experience in development of software for circuit switched protocols and recent projects have involved LTE and SIP. With an in-depth knowledge of  C/C++, Java, Javascript and shell scripting,  Richard earned a PhD degree in Electronic Engineering from Manchester Metropolitan University.  Richard also holds a master’s degrees in Computer Communication & Networks from Leeds Metropolitan University and a bachelor’s degree in Computer Science from the University of Leeds.
 

Leave a Reply

%d bloggers like this: