navigator.mozGetUserMedia() has just landed in Firefox desktop nightly builds!

I know a lot of Mozillians have been waiting for this: Firefox nightly (http://nightly.mozilla.org/) for Desktop now supports navigator.mozGetUserMedia().

mozGetUserMedia is a new DOM API that allows a JavaScript application to easily access a user’s camera and/or microphone.  It’s part of the greater WebRTC project which will enable real-time video/audio/data connections from within the browser.  The spec is still under development in the W3C, and so this API is currently a prefixed API in Firefox.  We’d love help from the community to try it out over the next few months and let us know how it’s working and what improvements you’d like to see.

mozGetUserMedia is still preffed off by default, so you will have to browse to about:config and set media.navigator.enabled to true (it’s a boolean).  We don’t yet have the UI for the feature (to query permission for camera and microphone access and to communicate camera/microphone status), and we won’t be enabling mozGetUserMedia by default until we have UI.  Also, because this feature is brand new, we’re still working out a lot of the kinks.  There are some known issues that we’re in the process of resolving:

  • We don’t yet support mixing both audio and video into a single stream yet (you can obtain them individually though as two different streams). (Bug 773649)
  • We’re seeing clock drift, so the video or audio streams may appear to start lagging after a while (Bug 771834)
  • On some systems, capturing audio doesn’t work a second time without restarting the browser (Bug 773646)

Note: we don’t currently support “stream_url=URL.createObjURL(stream); video.src=stream_url;”.  Instead we support “video.src=stream;”.   It’s under discussion in the W3C as to which one (or both) will be required.

To look at some sample code and try out a simple demo, browse to https://people.mozilla.com/~anarayanan/gum_test.html and look at the page source.

Please help us test and let us know what you think.  If you find bugs while using mozGetUserMedia, please report them at bugzilla.mozilla.org (Product: Core, Component:WebRTC).  If you want to give feedback on this feature or our implementation of it, please post to Mozilla’s dev.media newsgroup.
Thanks in advance for any help you can give us on this!

I’m so excited that WebRTC is finally happening!  getUserMedia is the first major piece of a project that has the power to revolutionize the web and impact how we live our daily lives. And I’m thrilled that Mozilla is helping to make that possible.