Confirmed users
325
edits
(→Goal) |
(Total rewrite; still needs more work) |
||
| Line 1: | Line 1: | ||
= getUserMedia | = getUserMedia = | ||
== Goal == | == Goal == | ||
* | * Define and implement navigator.getUserMedia with the W3C's WebRTC WG and Media Capture Task Force | ||
* Current editor's draft: [http://dev.w3.org/2011/webrtc/editor/getusermedia.html| W3 getUserMedia Editor's Draft] | |||
* Scenarios: [https://dvcs.w3.org/hg/dap/raw-file/tip/media-stream-capture/scenarios.html| W3 MediaStream Capture Scenarios] | |||
* Implement getUserMedia on Desktop, then Android, then B2G -- Implemented on Desktop, defaults to enabled in FF20 and FF21 | == Status == | ||
* Implement getUserMedia on Desktop, then Android, then B2G -- Implemented on Desktop (Windows, Mac and Linux), defaults to enabled in FF20 and FF21 | |||
** Currently prefixed as mozGetUserMedia() since the spec is still in flux | |||
** For FF19 and FF18, you need to set <b><tt>media.navigator.enabled</tt></b> to true, or <tt><b> media.peerconnection.enabled</b></tt> to true. | |||
* Permissions UI is supported, allowing selecting a device or rejecting permission, with notifications that a tab is using a mic or camera, and a global dropdown of all tabs using mics/cameras. | |||
* Persistent permissions are not yet supported | |||
* Explicit revocation of permission currently requires navigating away or closing the tab. | |||
* Supports multiple tabs getting data from the same mic or camera (if the user allows) | |||
* Capture resolution currently fixed to 640x480 for video; 16000Hz for audio | |||
* No echo cancellation is turned on in getUserMedia, so connecting an captured audio stream to an audio element may cause feedback | |||
* | * Minimal constraints supported: (Note: all of these booleans default to 'false') | ||
<pre> | |||
video: true/false | |||
audio: true/false | |||
fake: true/false | |||
picture: true/false | |||
</pre> | |||
Example use in FF: | |||
<pre> | <pre> | ||
mozGetUserMedia({picture: true}, onsuccess(Blob blob), onerror); | |||
mozGetUserMedia({video: true, audio: true}, | |||
function (MediaStream stream) { video.mozSrcObject = stream; }, | |||
function (err) { dump("mozGetUserMedia error: " + err); } ); | |||
</pre> | </pre> | ||
Demos: [http://mozilla.github.com/webrtc-landing| WebRTC demos including mozGetUserMedia] | |||
== | == Differences from Chrome webkitGetUserMedia() == | ||
* | Includes, but not limited to: | ||
* | * Name :-) | ||
* Firefox leaves the mic/camera active (light on, etc) until the application explicitly calls mediastream.stop(). Chrome turns them on when assigned to a media element or PeerConnection, and off again when removed. | |||
** Note that if an application drops all references to a MediaStream but does not call stop(), the camera will remain active for some period of time (or until you navigate to another page in the tab or close the tab). | |||
** This behavior may change in the future | |||
* Both now support window.URL.createObjectURL(stream), though Mozilla recommends against using it unless you have to. We expect Chrome to support srcObject = stream soon (perhaps prefixed as we are currently) | |||
* **This list needs to be expanded** | |||