mozilla

Revision 455693 of API de MediaStream

  • Revision slug: WebRTC/MediaStream_API
  • Revision title: MediaStream API
  • Revision id: 455693
  • Created:
  • Creator: maedca
  • Is current revision? No
  • Comment

Revision Content

{{SeeCompatTable}}

La MediaStream Processing API, often called the Media Stream API or the Stream API,  is the part of WebRTC describing a stream of audio or video data, the methods for working with them, the constraints associated with the type of data, the success and error callbacks when using the data asynchronously, and the events that are fired during the process.

Basic concepts

The API is based on the manipulation of a {{domxref("MediaStream")}} object representing a flux of audio- or video-related data. Typically a MediaStream object is as a simple URL string which can be used to reference data stored in a DOM {{domxref("File")}}, or a {{domxref("Blob")}} object created with {{domxref("window.URL.createObjectURL()")}}, as described in Get the video.

A MediaStream consists of zero or more {{domxref("MediaStreamTrack")}} objects, representing various audio or video tracks. Each MediaStreamTrack may have one or more channels. The channel represents the smallest unit of a media stream, such as an audio signal associated with a given speaker, like left or right in a stereo audio track.

MediaStream objects have a single input and a single output. A MediaStream object generated by getUserMedia() is called local, and has as its source input one of the user's cameras or microphones. A non-local MediaStream may be representing to a media element, like {{HTMLElement("video")}} or {{HTMLElement("audio")}}, a stream originating over the network, and obtained via the WebRTC PeerConnection API, or a stream created using the Web Audio API {{domxref("MediaStreamAudioSourceNode")}}.   The output of the MediaStream object is linked to a consumer. It can be a media elements, like <audio> or <video>,  the WebRTC PeerConnection API or a Web Audio API {{domxref("MediaStreamAudioDestinationNode")}}.

Reference

  • {{event("addtrack")}} (event)
  • {{domxref("AudioStreamTrack")}}
  • {{domxref("BlobEvent")}}
  • {{domxref("BlobEventInit")}}
  • {{event("ended (MediaStream)")}} (event)
  • {{event("ended (MediaStreamTrack)")}} (event)
  • {{domxref("MediaStream")}}
  • {{domxref("MediaStreamConstraints")}}
  • {{domxref("MediaStreamTrack")}}
  • {{domxref("MediaStreamTrackEvent")}}
  • {{domxref("MediaStreamTrackList")}}
  • {{domxref("MediaTrackConstraints")}}
  • {{event("muted")}} (event)
  • {{domxref("NavigatorUserMedia")}}
  • {{domxref("NavigatorUserMediaError")}}
  • {{event("overconstrained")}} (event)
  • {{event("removetrack")}} (event)
  • {{event("started")}} (event)
  • {{event("unmuted")}} (event)
  • {{domxref("URL")}}
  • {{domxref("VideoStreamTrack")}}

MediaStreamTrack

A MediaStreamTrack is one of two kinds, audio or video, and represents the media source, such as a camera.

Attributes

Attribute  Type Description
enabled Boolean  True if the track is still associated with its source.
id DOMString, read-only A globally unique identifier (GUID) which describes the media track.
kind DOMString, read-only The audio or video for the source of the track.
label DOMString, read-only A user agent-assigned string that identifies the track source, as in "internal microphone." 
onended EventHandler Handles the ended event when fired on the MediaStreamTrack object.
onmute  EventHandler Handles the muted event when fired on the MediaStreamTrack object. 
onoverconstrained EventHandler Handles the overconstrained event when fired on the MediaStreamTrack object.
onstarted EventHandler Handles the started event when fired on the MediaStreamTrack object.
onunmute  EventHandler Handles the unmuted event when fired on the MediaStreamTrack object.
readyState unsigned short, read-only

The track's ready state; values:

  • live - the track is active; the output may be switched on and off with the enabled attribute.
  • muted - the track's underlying media source is temporarily unable to provide realtime data.
sourceId DOMString, read-only The identity of this source that is unique to this application and persistent between sessions. A GUID is recommended but not required.
sourceType SourceTypeEnum, read-only Contains the type information of the source, if one exists.

Events

Event  Interface  Description 
started Event The MediaStreamTrack object is no longer in the "new" readyState.
muted Event The MediaStreamTrack object's source is temporarily unable to provide data. 
unmuted  Event The MediaStreamTrack object's source has resumed providing data.
overconstrained Event The MediaStreamTrack object's source cannot be configured to fit the constraints imposed by the track. This could be height in the case of video, among several others.
ended Event

The MediaStreamTrack object's source will not provide data; this may be caused by the following:

  • the user has revoked permissions on the application
  • the source device has been disconnected
  • the remote peer has stopped sending data
  • the stop() method was invoked

appendConstraint()

Adds the constraint to the end of the list. This is only a method of adding optional constraints.

Parameters
constraintName DOMString, required.
constraintValue Primitive (DOMString, float, etc.) or MinMaxConstraint, required.
Returns
void
Exceptions
None.

applyConstraints()

Applies the list of optional constraints to the track. This overwrites any existing optional constraints on the track.

Parameters
constraints MediaTrackConstraints, required.
Returns
void
Exceptions
None.

constraints()

Returns all constraints on the track, mandatory and optional. If either mandatory or optional have no constraints, that field will be undefined. If neither have constraints, then constraints() will return null.

Parameters
None.
Returns
MediaTrackConstraints or null
Exceptions
None.

getConstraint()

Fetches a specific constraint, by name, from the track. This method can return one of many possibilities:

  • If your constraint does not exist, null is returned.
  • If you do not provide true to this method's optional mandatory parameter, and your query matches one or more constraints, this method will return a list. Each item in the list will be the query name and either its value or a MinMaxConstraint object. The list is sorted: the 0th entry is most important, and each entry thereafter is progressively less important.
  • If your provide true to the mandatory parameter, and your query is a member of the MediaTrackConstraintSet for the track, this method returns either its primitive value or its MinMaxConstraint, whichever applies.
Parameters
constraintName DOMString, required.
mandatory boolean, optional, default false.
Returns
Any of the possibilities mentioned above.
Exceptions
None.

--

stop()

Permanently halts the generation of data for the tracks' sources and removes the references to the sources.

Parameters
None.
Returns
Void.
Exceptions
None.

MediaStreamTrackList

A MediaStream has two MediaStreamTrackList objects, one for the video and one for the audio tracks.

Attribute  Type Description
length unsigned long, read-only  The number of tracks in the list. 
onaddtrack  EventHandler Handles the addtrack event.
onremovetrack  EventHandler Handles the removetrack event.

Events

Event  Interface  Description 
addtrack  MediaStreamTrackEvent  A MediaStreamTrack has been added to the list. 
removetrack  MediaStreamTrackEvent A MediaStreamTrack has been removed from the list. 

add()

Adds a MediaStreamTrack to this track list.

Parameters
MediaStreamTrack track, required.
Returns
Void.
Exceptions
INVALID_STATE_ERR if the stream is finished (all tracks have ended).

item()

Returns the MediaStreamTrack at the specified index value.

Parameters
unsigned long index, required.
Returns
MediaStreamTrack
Exceptions
None.

Remove()

Removes a MediaStreamTrack from this track list.

Parameters
MediaStreamTrack track, required.
Returns
Void.
Exceptions
INVALID_STATE_ERR if the stream is finished (all tracks have ended).

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera  Safari (WebKit)
Stream API  21{{ property_prefix("webkit") }}  nightly 18{{ property_prefix("moz") }}  {{ CompatUnknown() }}  12 {{ CompatUnknown() }} 
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Stream API  {{ CompatNo() }}  {{ CompatUnknown() }} {{ CompatUnknown() }}  {{ CompatNo() }}  {{ CompatNo() }} 

Currently using WebRTC for accessing the camera is supported in Chrome, Opera and Firefox Nightly 18. Enabling WebRTC in Firefox Nightly requires you to set a flag in the configuration:

  • Type "about:config" in the address bar and say yes that you want to make changes
  • Find the "media.navigator.enabled" entry and set it to true

See Also

Revision Source

<p>{{SeeCompatTable}}</p>
<p>La <strong>MediaStream Processing API</strong>, often called the <em>Media Stream API</em> or the <em>Stream API</em>,&nbsp; is the part of <a href="/en-US/docs/WebRTC" title="/en-US/docs/WebRTC">WebRTC</a> describing a stream of audio or video data, the methods for working with them, the constraints associated with the type of data, the success and error callbacks when using the data asynchronously, and the events that are fired during the process.</p>
<h2 id="Basic_concepts">Basic concepts</h2>
<p>The API is based on the manipulation of a {{domxref("MediaStream")}} object representing a flux of audio- or video-related data. Typically a <code>MediaStream</code> object is as a simple URL string which can be used to reference data stored in a DOM {{domxref("File")}}, or a {{domxref("Blob")}} object created with {{domxref("window.URL.createObjectURL()")}}, as described in <a href="/en-US/docs/WebRTC/taking_webcam_photos#Get_the_video" title="/en-US/docs/WebRTC/taking_webcam_photos#Get_the_video">Get the video</a>.</p>
<p>A <code>MediaStream</code> consists of zero or more {{domxref("MediaStreamTrack")}} objects, representing various audio or video <strong>tracks</strong>. Each <code>MediaStreamTrack</code> may have one or more <strong>channels</strong>. The channel represents the smallest unit of a media stream, such as an audio signal associated with a given speaker, like <em>left</em> or <em>right</em> in a stereo audio track.</p>
<p><code>MediaStream</code> objects have a single <strong>input</strong> and a single <strong>output</strong>. A <code>MediaStream</code> object generated by <code><a href="/en-US/docs/WebRTC/navigator.getUserMedia" title="/en-US/docs/WebRTC/navigator.getUserMedia">getUserMedia()</a></code> is called <em>local</em>, and has as its source input one of the user's cameras or microphones. A non-local <code>MediaStream</code> may be representing to a media element, like {{HTMLElement("video")}} or {{HTMLElement("audio")}}, a stream originating over the network, and obtained via the WebRTC <a href="/en-US/docs/WebRTC/PeerConnection_API" title="/en-US/docs/WebRTC/PeerConnection_API">PeerConnection API</a>, or a stream created using the <a href="/en-US/docs/Web_Audio_API" title="/en-US/docs/Web_Audio_API">Web Audio API</a> {{domxref("MediaStreamAudioSourceNode")}}. &nbsp; The output of the <code>MediaStream</code> object is linked to a <strong>consumer</strong>. It can be a media elements, like <code>&lt;audio&gt;</code> or <code>&lt;video&gt;</code>,&nbsp; the WebRTC <a href="/en-US/docs/WebRTC/PeerConnection_API" title="/en-US/docs/WebRTC/PeerConnection_API">PeerConnection API</a> or a <a href="/en-US/docs/Web_Audio_API" title="/en-US/docs/Web_Audio_API">Web Audio API</a> {{domxref("MediaStreamAudioDestinationNode")}}.</p>
<h2 id="Reference">Reference</h2>
<div class="index">
  <ul>
    <li>{{event("addtrack")}} (event)</li>
    <li>{{domxref("AudioStreamTrack")}}</li>
    <li>{{domxref("BlobEvent")}}</li>
    <li>{{domxref("BlobEventInit")}}</li>
    <li>{{event("ended (MediaStream)")}} (event)</li>
    <li>{{event("ended (MediaStreamTrack)")}} (event)</li>
    <li>{{domxref("MediaStream")}}</li>
    <li>{{domxref("MediaStreamConstraints")}}</li>
    <li>{{domxref("MediaStreamTrack")}}</li>
    <li>{{domxref("MediaStreamTrackEvent")}}</li>
    <li>{{domxref("MediaStreamTrackList")}}</li>
    <li>{{domxref("MediaTrackConstraints")}}</li>
    <li>{{event("muted")}} (event)</li>
    <li>{{domxref("NavigatorUserMedia")}}</li>
    <li>{{domxref("NavigatorUserMediaError")}}</li>
    <li>{{event("overconstrained")}} (event)</li>
    <li>{{event("removetrack")}} (event)</li>
    <li>{{event("started")}} (event)</li>
    <li>{{event("unmuted")}} (event)</li>
    <li>{{domxref("URL")}}</li>
    <li>{{domxref("VideoStreamTrack")}}</li>
  </ul>
</div>
<h2 id="MediaStreamTrack">MediaStreamTrack</h2>
<p>A MediaStreamTrack is one of two kinds, audio or video, and represents the media source, such as a camera.</p>
<h3 id="Attributes">Attributes</h3>
<table>
  <thead>
    <tr>
      <th scope="col">Attribute&nbsp;</th>
      <th scope="col">Type</th>
      <th scope="col">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>enabled</td>
      <td>Boolean&nbsp;</td>
      <td>True if the track is still associated with its source.</td>
    </tr>
    <tr>
      <td>id</td>
      <td>DOMString, read-only</td>
      <td>A globally unique identifier (GUID) which describes the media track.</td>
    </tr>
    <tr>
      <td>kind</td>
      <td>DOMString, read-only</td>
      <td>The&nbsp;<strong>audio</strong>&nbsp;or <strong>video</strong> for the source of the track.</td>
    </tr>
    <tr>
      <td>label</td>
      <td>DOMString, read-only</td>
      <td>A user agent-assigned string that identifies the track source, as in "internal microphone."&nbsp;</td>
    </tr>
    <tr>
      <td>onended</td>
      <td>EventHandler</td>
      <td>Handles the ended event when fired on the MediaStreamTrack object.</td>
    </tr>
    <tr>
      <td>onmute&nbsp;</td>
      <td>EventHandler</td>
      <td>Handles the muted event when fired on the MediaStreamTrack object.&nbsp;</td>
    </tr>
    <tr>
      <td>onoverconstrained</td>
      <td>EventHandler</td>
      <td>Handles the overconstrained event when fired on the MediaStreamTrack object.</td>
    </tr>
    <tr>
      <td>onstarted</td>
      <td>EventHandler</td>
      <td>Handles the started event when fired on the MediaStreamTrack object.</td>
    </tr>
    <tr>
      <td>onunmute&nbsp;</td>
      <td>EventHandler</td>
      <td>Handles the unmuted event when fired on the MediaStreamTrack object.</td>
    </tr>
    <tr>
      <td>readyState</td>
      <td>unsigned short, read-only</td>
      <td>
        <p>The track's ready state; values:</p>
        <ul>
          <li>live - the track is active; the output may be switched on and off with the enabled attribute.</li>
          <li>muted - the track's underlying media source is temporarily unable to provide realtime data.</li>
        </ul>
      </td>
    </tr>
    <tr>
      <td>sourceId</td>
      <td>DOMString, read-only</td>
      <td>The identity of this source that is unique to this application and persistent between sessions. A GUID is recommended but not required.</td>
    </tr>
    <tr>
      <td>sourceType</td>
      <td>SourceTypeEnum, read-only</td>
      <td>Contains the type information of the source, if one exists.</td>
    </tr>
  </tbody>
</table>
<h3 id="Events">Events</h3>
<table>
  <thead>
    <tr>
      <th scope="col">Event&nbsp;</th>
      <th scope="col">Interface&nbsp;</th>
      <th scope="col">Description&nbsp;</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>started</td>
      <td>Event</td>
      <td>The MediaStreamTrack object is no longer in the "new" readyState.</td>
    </tr>
    <tr>
      <td>muted</td>
      <td>Event</td>
      <td>The MediaStreamTrack object's source is temporarily unable to provide data.&nbsp;</td>
    </tr>
    <tr>
      <td>unmuted&nbsp;</td>
      <td>Event</td>
      <td>The MediaStreamTrack object's source has resumed providing data.</td>
    </tr>
    <tr>
      <td>overconstrained</td>
      <td>Event</td>
      <td>The MediaStreamTrack object's source cannot be configured to fit the constraints imposed by the track. This could be height in the case of video, among several others.</td>
    </tr>
    <tr>
      <td>ended</td>
      <td>Event</td>
      <td>
        <p>The MediaStreamTrack object's source will not provide data; this may be caused by the following:</p>
        <ul>
          <li>the user has revoked permissions on the application</li>
          <li>the source device has been disconnected</li>
          <li>the remote peer has stopped sending data</li>
          <li>the stop() method was invoked</li>
        </ul>
      </td>
    </tr>
  </tbody>
</table>
<h3 id="appendConstraint()">appendConstraint()</h3>
<p>Adds the constraint to the end of the list. This is only a method of adding optional constraints.</p>
<dl>
  <dt>
    Parameters</dt>
  <dd>
    constraintName <strong>DOMString</strong>, required.</dd>
  <dd>
    constraintValue <strong>Primitive (DOMString, float, etc.) </strong>or<strong> MinMaxConstraint</strong>, required.</dd>
  <dt>
    Returns</dt>
  <dd>
    void</dd>
  <dt>
    Exceptions</dt>
  <dd>
    None.</dd>
</dl>
<h3 id="applyConstraints()">applyConstraints()</h3>
<p>Applies the list of optional constraints to the track. This overwrites any existing optional constraints on the track.</p>
<dl>
  <dt>
    <strong>Parameters</strong></dt>
  <dd>
    constraints <strong>MediaTrackConstraints</strong>, required.</dd>
  <dt>
    Returns</dt>
  <dd>
    void</dd>
  <dt>
    Exceptions</dt>
  <dd>
    None.</dd>
</dl>
<h3 id="constraints()">constraints()</h3>
<p>Returns all constraints on the track, mandatory and optional. If either <code>mandatory</code> or <code>optional</code> have no constraints, that field will be <code>undefined</code>. If neither have constraints, then <code>constraints()</code> will return <code>null</code>.</p>
<dl>
  <dt>
    Parameters</dt>
  <dd>
    None.</dd>
  <dt>
    Returns</dt>
  <dd>
    <strong>MediaTrackConstraints</strong> or <strong>null</strong></dd>
  <dt>
    <span id="cke_bm_186C" style="display: none;">&nbsp;</span>Exceptions</dt>
  <dd>
    None.</dd>
</dl>
<h3 id="getConstraint()">getConstraint()</h3>
<p>Fetches a specific constraint, by name, from the track. This method can return one of many possibilities:</p>
<ul>
  <li>If your constraint does not exist, <code>null</code> is returned.</li>
  <li>If you do not provide <code>true</code> to this method's optional <code>mandatory </code>parameter, and your query matches one or more constraints, this method will return a list. Each item in the list will be the query name and either its value or a <code>MinMaxConstraint</code> object. The list is sorted: the 0th entry is most important, and each entry thereafter is progressively less important.</li>
  <li>If your provide <code>true</code> to the <code>mandatory</code> parameter, and your query is a member of the <code>MediaTrackConstraintSet</code> for the track, this method returns either its primitive value or its <code>MinMaxConstraint</code>, whichever applies.</li>
</ul>
<dl>
  <dt>
    Parameters</dt>
  <dd>
    constraintName <strong>DOMString</strong>, required.</dd>
  <dd>
    mandatory <strong>boolean</strong>, optional, default false.</dd>
  <dt>
    Returns</dt>
  <dd>
    Any of the possibilities mentioned above.</dd>
  <dt>
    Exceptions</dt>
  <dd>
    None.</dd>
</dl>
<p>--</p>
<h3 id="stop()">stop()</h3>
<p>Permanently halts the generation of data for the tracks' sources and removes the references to the sources.</p>
<dl>
  <dt>
    Parameters</dt>
  <dd>
    None.</dd>
  <dt>
    Returns</dt>
  <dd>
    Void.</dd>
  <dt>
    Exceptions</dt>
  <dd>
    None.</dd>
</dl>
<h2 id="MediaStreamTrackList">MediaStreamTrackList</h2>
<p>A MediaStream has two MediaStreamTrackList objects, one for the video and one for the audio tracks.</p>
<table>
  <thead>
    <tr>
      <th scope="col">Attribute&nbsp;</th>
      <th scope="col">Type</th>
      <th scope="col">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>length</td>
      <td>unsigned long, read-only&nbsp;</td>
      <td>The number of tracks in the list.&nbsp;</td>
    </tr>
    <tr>
      <td>onaddtrack&nbsp;</td>
      <td>EventHandler</td>
      <td>Handles the addtrack event.</td>
    </tr>
    <tr>
      <td>onremovetrack&nbsp;</td>
      <td>EventHandler</td>
      <td>Handles the removetrack event.</td>
    </tr>
  </tbody>
</table>
<h3 id="Events">Events</h3>
<table>
  <thead>
    <tr>
      <th scope="col">Event&nbsp;</th>
      <th scope="col">Interface&nbsp;</th>
      <th scope="col">Description&nbsp;</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>addtrack&nbsp;</td>
      <td>MediaStreamTrackEvent&nbsp;</td>
      <td>A MediaStreamTrack has been added to the list.&nbsp;</td>
    </tr>
    <tr>
      <td>removetrack&nbsp;</td>
      <td>MediaStreamTrackEvent</td>
      <td>A MediaStreamTrack has been removed from the list.&nbsp;</td>
    </tr>
  </tbody>
</table>
<h3 id="add()">add()</h3>
<p>Adds a MediaStreamTrack to this track list.</p>
<dl>
  <dt>
    Parameters</dt>
  <dd>
    MediaStreamTrack <strong>track</strong>, required.</dd>
  <dt>
    Returns</dt>
  <dd>
    Void.</dd>
  <dt>
    Exceptions</dt>
  <dd>
    INVALID_STATE_ERR if the stream is finished (all tracks have ended).</dd>
</dl>
<h3 id="item().C2.A0">item()<span id="cke_bm_369C" style="display: none; ">&nbsp;</span></h3>
<p>Returns the MediaStreamTrack at the specified index value.</p>
<dl>
  <dt>
    Parameters</dt>
  <dd>
    unsigned long <strong>index</strong>, required.</dd>
  <dt>
    Returns</dt>
  <dd>
    MediaStreamTrack</dd>
  <dt>
    Exceptions</dt>
  <dd>
    None.</dd>
</dl>
<h3 id="Remove()">Remove()</h3>
<p>Removes a MediaStreamTrack from this track list.</p>
<dl>
  <dt>
    Parameters</dt>
  <dd>
    MediaStreamTrack&nbsp;<strong>track</strong>, required.</dd>
  <dt>
    Returns</dt>
  <dd>
    Void.</dd>
  <dt>
    Exceptions</dt>
  <dd>
    INVALID_STATE_ERR if the stream is finished (all tracks have ended).</dd>
</dl>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera&nbsp;</th>
        <th>Safari (WebKit)</th>
      </tr>
      <tr>
        <td>Stream API&nbsp;</td>
        <td>21{{ property_prefix("webkit") }}&nbsp;</td>
        <td>nightly 18{{ property_prefix("moz") }}&nbsp;</td>
        <td>{{ CompatUnknown() }}&nbsp;</td>
        <td>12</td>
        <td>{{ CompatUnknown() }}&nbsp;</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE&nbsp;Phone</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Stream API&nbsp;</td>
        <td>{{ CompatNo() }}&nbsp;</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}&nbsp;</td>
        <td>{{ CompatNo() }}&nbsp;</td>
        <td>{{ CompatNo() }}&nbsp;</td>
      </tr>
    </tbody>
  </table>
</div>
<p><span style="line-height: 1.5em; ">Currently using WebRTC for accessing the camera is supported in Chrome, Opera and Firefox Nightly 18. Enabling WebRTC in Firefox Nightly requires you to set a flag in the configuration:</span></p>
<ul style="margin: 0px 0px 1.286em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; ">
  <li>Type "about:config" in the address bar and say yes that you want to make changes</li>
  <li>Find the "media.navigator.enabled" entry and set it to true</li>
</ul>
<h2 id="See_Also">See Also</h2>
<ul>
  <li><a href="/en-US/docs/WebRTC" title="/en-US/docs/WebRTC">WebRTC</a> - the introductory page to the API</li>
  <li><a href="/en-US/docs/WebRTC/navigator.getUserMedia" title="/en-US/docs/WebRTC/navigator.getUserMedia">getUserMedia()</a></li>
  <li><a href="/en-US/docs/WebRTC/taking_webcam_photos" title="/en-US/docs/WebRTC/taking_webcam_photos">Taking webcam photos</a>&nbsp;- a tutorial on using getUserMedia()</li>
</ul>
Revert to this revision