Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1115329 of HTMLMediaElement

  • Revision slug: Web/API/HTMLMediaElement
  • Revision title: HTMLMediaElement
  • Revision id: 1115329
  • Created:
  • Creator: slimsag
  • Is current revision? No
  • Comment

Revision Content

{{APIRef("HTML DOM")}}

The HTMLMediaElement interface adds to {{domxref("HTMLElement")}} the properties and methods needed to support basic media-related capabilities that are common to audio and video. The {{domxref("HTMLVideoElement")}} and {{domxref("HTMLAudioElement")}} elements both inherit this interface.

Properties

This interface also inherits properties from its ancestors {{domxref("HTMLElement")}}, {{domxref("Element")}}, {{domxref("Node")}}, and {{domxref("EventTarget")}}.

{{domxref("HTMLMediaElement.audioTracks")}}
Is a {{domxref("AudioTrackList")}} that lists the {{domxref("AudioTrack")}} objects contained in the element.
{{domxref("HTMLMediaElement.autoplay")}}
Is a {{jsxref("Boolean")}} that reflects the {{htmlattrxref("autoplay", "video")}} HTML attribute, indicating whether playback should automatically begin as soon as enough media is available to do so without interruption.
{{domxref("HTMLMediaElement.buffered")}}{{readonlyinline}}
Returns a {{domxref("TimeRanges")}} object that indicates the ranges of the media source that the browser has buffered (if any) at the moment the buffered property is accessed.
{{domxref("HTMLMediaElement.controller")}}
Is a {{domxref("MediaController")}} object that represents the media controller assigned to the element, or null if none is assigned.
{{domxref("HTMLMediaElement.controls")}}
Is a {{jsxref('Boolean')}} that reflects the {{htmlattrxref("controls", "video")}} HTML attribute, indicating whether user interface items for controlling the resource should be displayed.
{{domxref("HTMLMediaElement.crossOrigin")}}
Is a {{domxref("DOMString")}} indicating the CORS setting for this media element.
{{domxref("HTMLMediaElement.currentSrc")}}{{readonlyinline}}
Returns a {{domxref("DOMString")}} with the absolute URL of the chosen media resource.
{{domxref("HTMLMediaElement.currentTime")}}
Is a double indicating the current playback time in seconds. Setting this value seeks the media to the new time.
{{domxref("HTMLMediaElement.defaultMuted")}}
Is a {{jsxref('Boolean')}} that reflects the {{htmlattrxref("muted", "video")}} HTML attribute, which indicates whether the media element's audio output should be muted by default.
{{domxref("HTMLMediaElement.defaultPlaybackRate")}}
Is a double indicating the default playback rate for the media.
{{domxref("HTMLMediaElement.disableRemotePlayback")}}
Is a {{jsxref('Boolean')}} that sets or returns the remote playback state, indicating whether the media element is allowed to have a remote playback UI.
{{domxref("HTMLMediaElement.duration")}}{{readonlyinline}}
Returns a double indicating the length of the media in seconds, or 0 if no media data is available.
{{domxref("HTMLMediaElement.ended")}}{{readonlyinline}}
Returns a {{jsxref('Boolean')}} that indicates whether the media element has finished playing.
{{domxref("HTMLMediaElement.error")}}{{readonlyinline}}
Returns a {{domxref("MediaError")}} object for the most recent error, or null if there has not been an error.
{{domxref("HTMLMediaElement.initialTime")}}{{readonlyinline}} {{non-standard_inline}} {{deprecated_inline}}
Returns a double that indicates the initial playback position in seconds.
{{domxref("HTMLMediaElement.loop")}}
Is a {{jsxref('Boolean')}} that reflects the {{htmlattrxref("loop", "video")}} HTML attribute, which indicates whether the media element should start over when it reaches the end.
{{domxref("HTMLMediaElement.mediaGroup")}}
Is a {{domxref("DOMString")}} that reflects the {{ htmlattrxref("mediagroup", "video")}} HTML attribute, which indicates the name of the group of elements it belongs to. A group of media elements shares a common {{domxref('MediaController')}}.
{{domxref("HTMLMediaElement.mediaKeys")}}{{readonlyinline}} {{experimental_inline}}
Returns a {{domxref("MediaKeys")}} object or null. MediaKeys is a set of keys that an associated HTMLMediaElement can use for decryption of media data during playback.
{{domxref("HTMLMediaElement.mozAudioCaptured")}}{{readonlyinline}} {{non-standard_inline}}
Returns a {{jsxref('Boolean')}}. Related to audio stream capture.
{{domxref("HTMLMediaElement.mozAudioChannelType")}} {{non-standard_inline}}
(Firefox OS only) A {{jsxref('String')}} that can be used to set the audio channel that the sound coming from an {{htmlelement("audio")}} or {{htmlelement("video")}} element will play in, on a Firefox OS device. See Using the AudioChannels API for more details.
{{domxref("HTMLMediaElement.mozChannels")}}{{readonlyinline}} {{non-standard_inline}} {{deprecated_inline}}
Returns a double representing the number of channels in the audio resource (e.g., 2 for stereo).
{{domxref("HTMLMediaElement.mozFragmentEnd")}} {{non-standard_inline}}
Is a double that provides access to the fragment end time if the media element has a fragment URI for currentSrc, otherwise it is equal to the media duration.
{{domxref("HTMLMediaElement.mozFrameBufferLength")}} {{non-standard_inline}} {{deprecated_inline}}

Is a unsigned long that indicates the number of samples that will be returned in the framebuffer of each MozAudioAvailable event. This number is a total for all channels, and by default is set to be the number of channels * 1024 (e.g., 2 channels * 1024 samples = 2048 total).

The mozFrameBufferLength property can be set to a new value for lower latency, larger amounts of data, etc. The size given must be a number between 512 and 16384. Using any other size results in an exception being thrown. The best time to set a new length is after the loadedmetadata event fires, when the audio info is known, but before the audio has started or MozAudioAvailable events have begun firing.

{{domxref("HTMLMediaElement.mozSampleRate")}}{{readonlyinline}} {{non-standard_inline}} {{deprecated_inline}}
Returns a double representing the number of samples per second that will be played. For example, 44100 samples per second is the sample rate used by CD audio.
{{domxref("HTMLMediaElement.muted")}}
Is a {{jsxref('Boolean')}} that determines whether audio is muted. true if the audio is muted and false otherwise.
{{domxref("HTMLMediaElement.networkState")}}{{readonlyinline}}
Returns a unsigned short (enumeration) indicating the current state of fetching the media over the network.
{{domxref("HTMLMediaElement.paused")}}{{readonlyinline}}
Returns a {{jsxref('Boolean')}} that indicates whether the media element is paused.
{{domxref("HTMLMediaElement.playbackRate")}}

A double that indicates the rate at which the media is being played back. 

{{domxref("HTMLMediaElement.played")}}{{readonlyinline}}
Returns a {{domxref('TimeRanges')}} object that contains the ranges of the media source that the browser has played, if any.
{{domxref("HTMLMediaElement.preload")}}
Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("preload", "video")}} HTML attribute, indicating what data should be preloaded, if any. Possible values are: none, metadata, auto.
{{domxref("HTMLMediaElement.preservesPitch")}} {{non-standard_inline}}
Is a {{jsxref('Boolean')}} that determines if the pitch of the sound will be preserved. If set to false, the pitch will adjust to the speed of the audio. This is implemented with prefixes in Firefox (mozPreservesPitch) and WebKit (webkitPreservesPitch).
{{domxref("HTMLMediaElement.readyState")}}{{readonlyinline}}
Returns a unsigned short (enumeration) indicating the readiness state of the media.
{{domxref("HTMLMediaElement.seekable")}}{{readonlyinline}}
Returns a {{domxref('TimeRanges')}} object that contains the time ranges that the user is able to seek to, if any.
{{domxref("HTMLMediaElement.seeking")}}{{readonlyinline}}
Returns a {{jsxref('Boolean')}} that indicates whether the media is in the process of seeking to a new position.
{{domxref("HTMLMediaElement.sinkId")}}{{readonlyinline}} {{experimental_inline}}
Returns a {{domxref("DOMString")}} that is the unique ID of the audio device delivering output, or an empty string if it is using the user agent default. This ID should be one of the MediaDeviceInfo.deviceid values returned from {{domxref("MediaDevices.enumeratedDevices()")}}, id-multimedia, or id-communications.
{{domxref("HTMLMediaElement.src")}}
Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("src", "video")}} HTML attribute, which contains the URL of a media resource to use.
{{domxref("HTMLMediaElement.srcObject")}}
Is a {{domxref('MediaStream')}} representing the media to play or that has played in the current HTMLMediaElement.
{{domxref("HTMLMediaElement.textTracks")}}{{readonlyinline}}
Returns the list of {{domxref("TextTrack")}} objects contained in the element.
{{domxref("HTMLMediaElement.videoTracks")}}{{readonlyinline}}
Returns the list of {{domxref("VideoTrack")}} objects contained in the element.

Note: Gecko supports only single track playback, and the parsing of tracks' metadata is only available for media with the Ogg container format.

{{domxref("HTMLMediaElement.volume")}}
A double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest).

Event handler properties

{{domxref("HTMLMediaElement.onmozinterruptbegin")}}
Sets the {{domxref("EventHandler")}} called when the media element is interrupted because of the audiochannel manager.
{{domxref("HTMLMediaElement.onmozinterruptend")}}
Sets the {{domxref('EventHandler')}} called when the interruption is concluded.
{{domxref("HTMLMediaElement.onencrypted")}}
Sets the {{domxref('EventHandler')}} called when the media is encrypted.

Methods

This interface also inherits methods from its ancestors {{domxref("HTMLElement")}}, {{domxref('Element')}}, {{domxref('Node')}}, and {{domxref('EventTarget')}}.

{{domxref("HTMLMediaElement.addTextTrack()")}}
Adds a text track (such as a track for subtitles) to a media element.
{{domxref("HTMLMediaElement.canPlayType()")}}
Determines whether the specified media type can be played back.
{{domxref("HTMLMediaElement.fastSeek()")}}
Directly seeks to the given time.
{{domxref("HTMLMediaElement.load()")}}
Resets the media element and restarts the media resource. Any pending events are discarded. How much media data is fetched is still affected by the preload attribute. This method can be useful for releasing resources after any src attribute and source element descendants have been removed. Otherwise, it is usually unnecessary to use this method, unless required to rescan source element children after dynamic changes.
{{domxref("HTMLMediaElement.mozCaptureStream()")}} {{non-standard_inline}}
[enter description]
{{domxref("HTMLMediaElement.mozCaptureStreamUntilEnded()")}} {{non-standard_inline}}
[enter description]
{{domxref("HTMLMediaElement.mozGetMetadata()")}} {{non-standard_inline}}
Returns {{jsxref('Object')}}, which contains properties that represent metadata from the playing media resource as {key: value} pairs. A separate copy of the data is returned each time the method is called. This method must be called after the loadedmetadata event fires.
{{domxref("HTMLMediaElement.mozLoadFrom()")}} {{non-standard_inline}} {{deprecated_inline}}
This method, available only in Mozilla's implementation, loads data from another media element. This works similarly to load() except that instead of running the normal resource selection algorithm, the source is simply set to the other element's currentSrc. This is optimized so this element gets access to all of the other element's cached and buffered data; in fact, the two elements share downloaded data, so data downloaded by either element is available to both.
{{domxref("HTMLMediaElement.pause()")}}
Pauses the media playback.
{{domxref("HTMLMediaElement.play()")}}
Begins playback of the media.
{{domxref("HTMLMediaElement.seekToNextFrame()")}} {{non-standard_inline}} {{experimental_inline}}
Seeks to the next frame in the media. This non-standard, experimental method makes it possible to manually drive reading and rendering of media at a custom speed, or to move through the media frame-by-frame to perform filtering or other operations.
{{domxref("HTMLMediaElement.setMediaKeys()")}} {{experimental_inline}}
Returns {{jsxref("Promise")}}. Sets the {{domxref("MediaKeys")}} keys to use when decrypting media during playback.
{{domxref("HTMLMediaElement.setSinkId()")}} {{experimental_inline}}
Sets the ID of the audio device to use for output and returns a {{jsxref("Promise")}}. This only works when the application is authorized to use the specified device.

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', "the-video-element.html#htmlmediaelement", "HTMLMediaElement")}} {{Spec2('HTML WHATWG')}} No change from {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', "embedded-content-0.html#htmlmediaelement", "HTMLMediaElement")}} {{Spec2('HTML5 W3C')}} Initial definition.
{{SpecName('EME', '#introduction', 'Encrypted Media Extensions')}} {{Spec2('EME')}} Adds {{domxref("MediaKeys")}}, {{domxref("MediaEncryptedEvent")}}, and setMediaKeys.
{{SpecName('Media Capture','#htmlmediaelement-extensions','HTMLMediaElement')}} {{Spec2('Media Capture')}} Adds sinkId and setSinkId().

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatVersionUnknown}} {{CompatGeckoDesktop("1.9.1")}} [1] {{CompatIE("9")}} {{CompatUnknown}} {{CompatUnknown}}
buffered property {{CompatVersionUnknown}} {{CompatGeckoDesktop("2.0")}} {{CompatIE("9")}} {{CompatUnknown}} {{CompatUnknown}}
defaultMuted property {{CompatVersionUnknown}} {{CompatGeckoDesktop("11.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
loop property {{CompatVersionUnknown}} {{CompatGeckoDesktop("11.0")}} {{CompatIE("9")}} {{CompatUnknown}} {{CompatUnknown}}
seekable property {{CompatVersionUnknown}} {{CompatGeckoDesktop("8.0")}} {{CompatIE("9")}} {{CompatUnknown}} {{CompatUnknown}}
defaultPlaybackRate property {{CompatVersionUnknown}} {{CompatGeckoDesktop("20.0")}} {{CompatIE("9")}} {{CompatUnknown}} {{CompatUnknown}}
playbackRate property {{CompatVersionUnknown}} {{CompatGeckoDesktop("20.0")}} {{CompatIE("9")}} {{CompatUnknown}} {{CompatUnknown}}
preservesPitch property {{non-standard_inline}} {{CompatVersionUnknown}}{{property_prefix("webkit")}} {{CompatGeckoDesktop("20.0")}}{{property_prefix("moz")}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
preload property {{CompatVersionUnknown}} {{CompatGeckoDesktop("2.0")}}[2] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
played property {{CompatVersionUnknown}} {{CompatGeckoDesktop("15.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
crossOrigin property {{CompatVersionUnknown}} {{CompatGeckoDesktop("12.0")}}[3]
{{ CompatGeckoDesktop("22.0")}}
 
{{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
mozAudioChannelType property {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
mozChannels, mozFrameBufferLength, mozSampleRate properties {{CompatNo}} {{CompatGeckoDesktop("2.0")}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
mozGetMetadata() {{CompatNo}} {{CompatGeckoDesktop("17.0")}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
mozLoadFrom() {{obsolete_inline(24)}} {{CompatNo}} {{CompatGeckoDesktop("1.9.2")}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
mozSrcObject property {{non-standard_inline}} {{CompatNo}} {{CompatGeckoDesktop("18.0")}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
initialTime property {{non-standard_inline}} {{CompatUnknown}} {{CompatGeckoDesktop("9.0")}}[4] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
fastSeek method {{CompatUnknown}} {{CompatGeckoDesktop("31.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
startDate property {{CompatUnknown}} {{ CompatNo}}[8] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
mediaGroup and controller properties {{CompatUnknown}} {{ CompatNo}}[9] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
audioTracks, and videoTracks properties {{CompatUnknown}} {{CompatGeckoDesktop("33.0")}} [5] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
textTracks property {{CompatUnknown}} {{CompatNightly}} [6] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
sinkId property and setSinkId() method {{CompatChrome(49.0)}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
seekToNextFrame() method {{CompatUnknown}} {{CompatGeckoDesktop(49)}} [10] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
srcObject {{CompatChrome(52.0)}}     39  
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
buffered property {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}}
defaultMuted property {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatGeckoMobile("11.0")}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}}
loop property {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatGeckoMobile("11.0")}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}}
seekable property {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatGeckoMobile("8.0")}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}}
defaultPlaybackRate property {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatGeckoMobile("20.0")}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}}
playbackRate property {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatGeckoMobile("20.0")}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}}
preservesPitch property {{non-standard_inline}} {{CompatVersionUnknown}}{{property_prefix("webkit")}} {{CompatVersionUnknown}} {{CompatGeckoMobile("20.0")}}{{property_prefix("moz")}} {{CompatVersionUnknown}} {{ CompatNo}} {{ CompatNo}} {{ CompatNo}} {{CompatVersionUnknown}}
preload property {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}}
played property {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatGeckoMobile("15.0")}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}}
crossOrigin property {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatGeckoMobile("12.0")}}[3]
{{ CompatGeckoMobile("22.0")}}
 
{{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}}
mozAudiochannelType {{CompatNo}} {{CompatNo}} {{CompatNo}} 1.0.1 {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
mozChannels, mozFrameBufferLength, mozSampleRate properties {{CompatNo}} {{CompatNo}} {{CompatGeckoMobile("2.0")}} {{CompatVersionUnknown}} {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
mozGetMetadata() {{CompatNo}} {{CompatNo}} {{CompatGeckoMobile("17.0")}} {{CompatVersionUnknown}} {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
mozLoadFrom() {{deprecated_inline}} {{CompatNo}} {{CompatNo}} {{CompatGeckoMobile("1.9.2")}}[7] {{CompatVersionUnknown}} {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
mozSrcObject property {{non-standard_inline}} {{CompatNo}} {{CompatNo}} {{CompatGeckoMobile("18.0")}} {{CompatVersionUnknown}} {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
initialTime property {{non-standard_inline}} {{CompatUnknown}} {{CompatUnknown}} {{CompatGeckoMobile("9.0")}}[4] {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
fastSeek method {{CompatUnknown}} {{CompatUnknown}} {{CompatGeckoMobile("31.0")}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
startDate property {{CompatUnknown}} {{CompatUnknown}} {{ CompatNo}}[8] {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
mediaGroup and controller properties {{CompatUnknown}} {{CompatUnknown}} {{ CompatNo}}[9] {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
audioTracks, and videoTracks properties {{CompatUnknown}} {{CompatUnknown}} {{CompatGeckoMobile("33.0")}}[5] {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
textTracks property {{CompatUnknown}} {{CompatUnknown}} {{CompatNightly}}[6] {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
sinkId property and setSinkId() method {{CompatUnknown}} {{CompatChrome(49.0)}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatChrome(49.0)}}
seekToNextFrame() method {{CompatUnknown}} {{CompatUnknown}} {{CompatGeckoMobile(49)}} [10] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
srcObject {{CompatNo}} {{CompatChrome(52.0)}}       39   {{CompatChrome(52.0)}}

[1] The NETWORK_LOADED state was removed to align with the HTML spec in Gecko 2.0 {{geckoRelease(2)}}.

[2] Previously Gecko implemented this as autobuffer.

[3] Gecko implements this in lowercase, i.e. crossorigin.

[4] The feature was removed in Gecko 23.0 {{ geckoRelease("23")}}.

[5] The implementation is hidden behind the media.track.enabled preference.

[6] The implementation is hidden behind the media.webvtt.enabled preference, defaulting there to true.

[7] This feature was removed in {{CompatGeckoMobile("24")}}.

[8] Gecko doesn't implement this yet. See {{bug("847376")}}.

[9] Gecko doesn't implement this yet. See {{bug("847377")}}.

[10] The preference {{pref("media.seekToNextFrame")}} must be enabled to use the {{domxref("HTMLMediaElement.seekToNextFrame", "seekToNextFrame()")}} method.

See also

Revision Source

<p>{{APIRef("HTML DOM")}}</p>

<p>The <strong><code>HTMLMediaElement</code></strong> interface adds to {{domxref("HTMLElement")}} the properties and methods needed to support basic media-related capabilities&nbsp;that are&nbsp;common to audio and video. The {{domxref("HTMLVideoElement")}} and {{domxref("HTMLAudioElement")}} elements both inherit this interface.</p>

<h2 id="Properties">Properties</h2>

<p><em>This interface also inherits properties from its ancestors&nbsp;</em><em>{{domxref("HTMLElement")}}, {{domxref("Element")}}, {{domxref("Node")}}, and {{domxref("EventTarget")}}.</em></p>

<dl>
 <dt>{{domxref("HTMLMediaElement.audioTracks")}}</dt>
 <dd>Is a {{domxref("AudioTrackList")}} that lists the {{domxref("AudioTrack")}} objects contained in the element.</dd>
 <dt>{{domxref("HTMLMediaElement.autoplay")}}</dt>
 <dd>Is a {{jsxref("Boolean")}} that reflects the {{htmlattrxref("autoplay", "video")}} HTML attribute, indicating whether playback should automatically begin as soon as enough media is available to do so without interruption.</dd>
 <dt>{{domxref("HTMLMediaElement.buffered")}}{{readonlyinline}}</dt>
 <dd>Returns a {{domxref("TimeRanges")}} object&nbsp;that indicates the ranges of the media source that the browser has buffered (if any) at the moment the <code>buffered</code> property is accessed.</dd>
 <dt>{{domxref("HTMLMediaElement.controller")}}</dt>
 <dd>Is a {{domxref("MediaController")}} object that represents the media controller assigned&nbsp;to the element, or <code>null</code> if none is assigned.</dd>
 <dt>{{domxref("HTMLMediaElement.controls")}}</dt>
 <dd>Is a {{jsxref('Boolean')}}&nbsp;that reflects the {{htmlattrxref("controls", "video")}} HTML attribute, indicating whether user interface items for controlling the resource should be displayed.</dd>
 <dt>{{domxref("HTMLMediaElement.crossOrigin")}}</dt>
 <dd>Is a {{domxref("DOMString")}} indicating&nbsp;the <a href="/en-US/docs/Web/HTML/CORS_settings_attributes">CORS setting</a> for this media element.</dd>
 <dt>{{domxref("HTMLMediaElement.currentSrc")}}{{readonlyinline}}</dt>
 <dd>Returns a&nbsp;{{domxref("DOMString")}} with the absolute URL of the chosen media resource.</dd>
 <dt>{{domxref("HTMLMediaElement.currentTime")}}</dt>
 <dd>Is a <code>double</code> indicating the current playback time&nbsp;in seconds. Setting this value seeks the media to the new time.</dd>
 <dt>{{domxref("HTMLMediaElement.defaultMuted")}}</dt>
 <dd>Is a {{jsxref('Boolean')}}&nbsp;that reflects the {{htmlattrxref("muted", "video")}} HTML attribute, which indicates&nbsp;whether the media element's audio output should be muted by default.</dd>
 <dt>{{domxref("HTMLMediaElement.defaultPlaybackRate")}}</dt>
 <dd>Is a <code>double</code> indicating the default playback rate for the media.</dd>
 <dt>{{domxref("HTMLMediaElement.disableRemotePlayback")}}</dt>
 <dd>Is a {{jsxref('Boolean')}}&nbsp;that sets or returns the remote playback state, indicating whether the media element is allowed to have a remote playback UI.</dd>
 <dt>{{domxref("HTMLMediaElement.duration")}}{{readonlyinline}}</dt>
 <dd>Returns a <code>double</code> indicating the length of the media in seconds, or 0&nbsp;if no media data is available.</dd>
 <dt>{{domxref("HTMLMediaElement.ended")}}{{readonlyinline}}</dt>
 <dd>Returns a {{jsxref('Boolean')}}&nbsp;that indicates whether the media element has finished playing.</dd>
 <dt>{{domxref("HTMLMediaElement.error")}}{{readonlyinline}}</dt>
 <dd>Returns a&nbsp;{{domxref("MediaError")}} object for the most recent error, or <code>null</code> if there has not been an error.</dd>
 <dt>{{domxref("HTMLMediaElement.initialTime")}}{{readonlyinline}} {{non-standard_inline}} {{deprecated_inline}}</dt>
 <dd>Returns a <code>double</code> that indicates the initial playback position in seconds.</dd>
 <dt>{{domxref("HTMLMediaElement.loop")}}</dt>
 <dd>Is a {{jsxref('Boolean')}}&nbsp;that reflects the {{htmlattrxref("loop", "video")}} HTML attribute, which indicates whether the media element should start over when it reaches the end.</dd>
 <dt>{{domxref("HTMLMediaElement.mediaGroup")}}</dt>
 <dd>Is a {{domxref("DOMString")}} that reflects the {{ htmlattrxref("mediagroup", "video")}} HTML attribute, which indicates the name of the group of elements it belongs to. A group of media elements shares a common {{domxref('MediaController')}}.</dd>
 <dt>{{domxref("HTMLMediaElement.mediaKeys")}}{{readonlyinline}} {{experimental_inline}}</dt>
 <dd>Returns a {{domxref("MediaKeys")}} object or <code>null</code>.&nbsp;MediaKeys is a set of keys that an associated HTMLMediaElement can use for decryption of media data during playback.</dd>
 <dt>{{domxref("HTMLMediaElement.mozAudioCaptured")}}{{readonlyinline}} {{non-standard_inline}}</dt>
 <dd>Returns a {{jsxref('Boolean')}}.&nbsp;Related to audio stream capture.</dd>
 <dt>{{domxref("HTMLMediaElement.mozAudioChannelType")}} {{non-standard_inline}}</dt>
 <dd>(Firefox OS only) A&nbsp;{{jsxref('String')}} that can be used to set the audio channel that the sound coming from an {{htmlelement("audio")}} or {{htmlelement("video")}} element will play in, on a Firefox OS device. See <a href="/en-US/docs/Web/API/AudioChannels_API/Using_the_AudioChannels_API">Using the AudioChannels API</a> for more details.</dd>
 <dt>{{domxref("HTMLMediaElement.mozChannels")}}{{readonlyinline}} {{non-standard_inline}}&nbsp;{{deprecated_inline}}</dt>
 <dd>Returns a <code>double</code> representing&nbsp;the number of channels in the audio resource (e.g., <code>2</code> for stereo).</dd>
 <dt>{{domxref("HTMLMediaElement.mozFragmentEnd")}} {{non-standard_inline}}</dt>
 <dd>Is a <code>double</code> that provides access to the fragment end time if the media element has a fragment URI for <code>currentSrc</code>, otherwise it is equal to the media duration.</dd>
 <dt>{{domxref("HTMLMediaElement.mozFrameBufferLength")}} {{non-standard_inline}}&nbsp;{{deprecated_inline}}</dt>
 <dd>
 <p>Is a&nbsp;<code>unsigned long</code> that indicates the number of samples that will be returned in the framebuffer of each <code>MozAudioAvailable</code> event. This number is a total for all channels, and by default is set to be the number of channels * 1024 (e.g., 2 channels * 1024 samples = 2048 total).</p>

 <p>The <code>mozFrameBufferLength</code> property can be set to a new value&nbsp;for lower latency,&nbsp;larger amounts of data, etc. The size given <em>must</em> be a number between 512 and 16384. Using any other size results in an exception being thrown. The best time to set a new length is after the <a href="/en-US/docs/Web/Events/loadedmetadata">loadedmetadata</a> event fires, when the audio info is known, but before the audio has started or <code>MozAudioAvailable</code> events have begun firing.</p>
 </dd>
 <dt>{{domxref("HTMLMediaElement.mozSampleRate")}}{{readonlyinline}} {{non-standard_inline}}&nbsp;{{deprecated_inline}}</dt>
 <dd>Returns a <code>double</code>&nbsp;representing the number of samples per second that will be played. For example, 44100 samples per second is the sample rate used by CD audio.</dd>
 <dt>{{domxref("HTMLMediaElement.muted")}}</dt>
 <dd>Is a {{jsxref('Boolean')}}&nbsp;that determines whether audio is muted. <code>true</code> if the audio is muted&nbsp;and <code>false</code> otherwise.</dd>
 <dt>{{domxref("HTMLMediaElement.networkState")}}{{readonlyinline}}</dt>
 <dd>Returns a&nbsp;<code>unsigned short</code>&nbsp;(enumeration) indicating the current state of fetching the media over the network.</dd>
 <dt>{{domxref("HTMLMediaElement.paused")}}{{readonlyinline}}</dt>
 <dd>Returns a {{jsxref('Boolean')}}&nbsp;that indicates whether the media element is paused.</dd>
 <dt>{{domxref("HTMLMediaElement.playbackRate")}}</dt>
 <dd>
 <p>A <code>double</code> that indicates the&nbsp;rate at which the media is being played back.&nbsp;</p>
 </dd>
 <dt>{{domxref("HTMLMediaElement.played")}}{{readonlyinline}}</dt>
 <dd>Returns a {{domxref('TimeRanges')}} object that contains&nbsp;the ranges of the media source that the browser has played, if any.</dd>
 <dt>{{domxref("HTMLMediaElement.preload")}}</dt>
 <dd>Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("preload", "video")}} HTML attribute, indicating what data should be preloaded, if any. Possible values are: <code>none</code>, <code>metadata</code>, <code>auto</code>.</dd>
 <dt>{{domxref("HTMLMediaElement.preservesPitch")}} {{non-standard_inline}}</dt>
 <dd>Is a {{jsxref('Boolean')}} that determines if the pitch of the sound&nbsp;will be preserved. If set to <code>false</code>, the pitch will adjust to the speed of the audio. This is implemented with prefixes in Firefox (<code>mozPreservesPitch</code>) and WebKit (<code>webkitPreservesPitch</code>).</dd>
 <dt>{{domxref("HTMLMediaElement.readyState")}}{{readonlyinline}}</dt>
 <dd>Returns a&nbsp;<code>unsigned short</code>&nbsp;(enumeration) indicating the readiness state of the media.</dd>
 <dt>{{domxref("HTMLMediaElement.seekable")}}{{readonlyinline}}</dt>
 <dd>Returns a {{domxref('TimeRanges')}} object that contains&nbsp;the time ranges that the user is able to seek to, if any.</dd>
 <dt>{{domxref("HTMLMediaElement.seeking")}}{{readonlyinline}}</dt>
 <dd>Returns a {{jsxref('Boolean')}} that&nbsp;indicates whether the media is in the process of seeking to a new position.</dd>
 <dt>{{domxref("HTMLMediaElement.sinkId")}}{{readonlyinline}} {{experimental_inline}}</dt>
 <dd>Returns a {{domxref("DOMString")}} that is&nbsp;the unique ID of the audio device delivering output, or an empty string if it is using the user agent default. This ID should be one of the <code>MediaDeviceInfo.deviceid</code> values returned from {{domxref("MediaDevices.enumeratedDevices()")}}, <code>id-multimedia</code>, or <code>id-communications</code>.</dd>
 <dt>{{domxref("HTMLMediaElement.src")}}</dt>
 <dd>Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("src", "video")}} HTML attribute, which contains the URL of a media resource to use.</dd>
 <dt>{{domxref("HTMLMediaElement.srcObject")}}</dt>
 <dd>Is a&nbsp;{{domxref('MediaStream')}} representing the media&nbsp;to play or that has played in the current <code>HTMLMediaElement</code>.</dd>
 <dt>{{domxref("HTMLMediaElement.textTracks")}}{{readonlyinline}}</dt>
 <dd>Returns the list of {{domxref("TextTrack")}} objects contained in the element.</dd>
 <dt>{{domxref("HTMLMediaElement.videoTracks")}}{{readonlyinline}}</dt>
 <dd>Returns the list of {{domxref("VideoTrack")}} objects contained in the element.
 <div class="note">
 <p><strong>Note: </strong>Gecko supports only single track playback, and the parsing of tracks' metadata is only available for media with the Ogg container format.</p>
 </div>
 </dd>
 <dt>{{domxref("HTMLMediaElement.volume")}}</dt>
 <dd>A <code>double</code> indicating the audio volume, from 0.0 (silent) to 1.0 (loudest).</dd>
</dl>

<h3 id="Event_handler_properties">Event handler properties</h3>

<dl>
 <dt>{{domxref("HTMLMediaElement.onmozinterruptbegin")}}</dt>
 <dd>Sets the {{domxref("EventHandler")}} called when the media element is interrupted because of the audiochannel manager.</dd>
 <dt>{{domxref("HTMLMediaElement.onmozinterruptend")}}</dt>
 <dd>Sets the {{domxref('EventHandler')}} called when the interruption is concluded.</dd>
 <dt>{{domxref("HTMLMediaElement.onencrypted")}}</dt>
 <dd>Sets the {{domxref('EventHandler')}} called when the media is encrypted.</dd>
</dl>

<h2 id="Methods">Methods</h2>

<p><em>This interface also inherits methods from its ancestors&nbsp;{{domxref("HTMLElement")}}, {{domxref('Element')}}, {{domxref('Node')}}, and {{domxref('EventTarget')}}.</em></p>

<dl>
 <dt>{{domxref("HTMLMediaElement.addTextTrack()")}}</dt>
 <dd>Adds a text track (such as a track for subtitles) to a media element.</dd>
 <dt>{{domxref("HTMLMediaElement.canPlayType()")}}</dt>
 <dd>Determines whether the specified media type can be played back.</dd>
 <dt>{{domxref("HTMLMediaElement.fastSeek()")}}</dt>
 <dd>Directly seeks to the given time.</dd>
 <dt>{{domxref("HTMLMediaElement.load()")}}</dt>
 <dd>Resets the media element and restarts the media resource. Any pending events are discarded. How much media data is fetched is still affected by the <code>preload</code> attribute. This method can be useful for releasing resources after any <code>src</code> attribute and <code>source</code> element descendants have been removed. Otherwise, it is usually unnecessary to use this method, unless required to rescan <code>source</code> element children after dynamic changes.</dd>
 <dt>{{domxref("HTMLMediaElement.mozCaptureStream()")}} {{non-standard_inline}}</dt>
 <dd>[enter description]</dd>
 <dt>{{domxref("HTMLMediaElement.mozCaptureStreamUntilEnded()")}} {{non-standard_inline}}</dt>
 <dd>[enter description]</dd>
 <dt>{{domxref("HTMLMediaElement.mozGetMetadata()")}} {{non-standard_inline}}</dt>
 <dd>Returns {{jsxref('Object')}},&nbsp;which contains&nbsp;properties that represent metadata from the playing media resource as <code>{key: value}</code> pairs. A separate copy of the data is returned each time the method is called. This method must be called after the <a href="/en-US/docs/Web/Events/loadedmetadata">loadedmetadata</a> event fires.</dd>
 <dt>{{domxref("HTMLMediaElement.mozLoadFrom()")}} {{non-standard_inline}} {{deprecated_inline}}</dt>
 <dd>This method, available only in Mozilla's implementation, loads data from another media element. This works similarly to <code>load()</code> except that instead of running the normal resource selection algorithm, the source is simply set to the <code>other</code> element's <code>currentSrc</code>. This is optimized so this element gets access to all of the <code>other</code> element's cached and buffered data; in fact, the two elements share downloaded data, so data downloaded by either element is available to both.</dd>
 <dt>{{domxref("HTMLMediaElement.pause()")}}</dt>
 <dd>Pauses the media playback.</dd>
 <dt>{{domxref("HTMLMediaElement.play()")}}</dt>
 <dd>Begins playback of the media.</dd>
 <dt>{{domxref("HTMLMediaElement.seekToNextFrame()")}} {{non-standard_inline}} {{experimental_inline}}</dt>
 <dd>Seeks to the next frame in the media. This non-standard, experimental method makes it possible to manually drive reading and rendering of media at a custom speed, or to move through the media frame-by-frame to perform filtering or other operations.</dd>
 <dt>{{domxref("HTMLMediaElement.setMediaKeys()")}} {{experimental_inline}}</dt>
 <dd>Returns {{jsxref("Promise")}}. Sets the {{domxref("MediaKeys")}} keys to use when decrypting media during playback.</dd>
 <dt>{{domxref("HTMLMediaElement.setSinkId()")}} {{experimental_inline}}</dt>
 <dd>Sets the ID of the audio device to use for output and returns a {{jsxref("Promise")}}. This only works when the application is authorized to use the specified device.</dd>
</dl>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('HTML WHATWG', "the-video-element.html#htmlmediaelement", "HTMLMediaElement")}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td>No change from {{SpecName('HTML5 W3C')}}</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', "embedded-content-0.html#htmlmediaelement", "HTMLMediaElement")}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td>Initial definition.</td>
  </tr>
  <tr>
   <td>{{SpecName('EME', '#introduction', 'Encrypted Media Extensions')}}</td>
   <td>{{Spec2('EME')}}</td>
   <td>Adds {{domxref("MediaKeys")}}, {{domxref("MediaEncryptedEvent")}}, and setMediaKeys.</td>
  </tr>
  <tr>
   <td>{{SpecName('Media Capture','#htmlmediaelement-extensions','HTMLMediaElement')}}</td>
   <td>{{Spec2('Media Capture')}}</td>
   <td>Adds <code>sinkId</code> and <code>setSinkId()</code>.</td>
  </tr>
 </tbody>
</table>

<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</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("1.9.1")}} [1]</td>
   <td>{{CompatIE("9")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>buffered</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("2.0")}}</td>
   <td>{{CompatIE("9")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>defaultMuted</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("11.0")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>loop</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("11.0")}}</td>
   <td>{{CompatIE("9")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>seekable</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("8.0")}}</td>
   <td>{{CompatIE("9")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>defaultPlaybackRate</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("20.0")}}</td>
   <td>{{CompatIE("9")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>playbackRate</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("20.0")}}</td>
   <td>{{CompatIE("9")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>preservesPitch</code> property {{non-standard_inline}}</td>
   <td>{{CompatVersionUnknown}}{{property_prefix("webkit")}}</td>
   <td>{{CompatGeckoDesktop("20.0")}}{{property_prefix("moz")}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>preload</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("2.0")}}[2]</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>played</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("15.0")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>crossOrigin</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("12.0")}}[3]<br />
    {{ CompatGeckoDesktop("22.0")}}<br />
    &nbsp;</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>mozAudioChannelType property</code></td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>mozChannels</code>, <code>mozFrameBufferLength</code>, <code>mozSampleRate</code> properties</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatGeckoDesktop("2.0")}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>mozGetMetadata()</code></td>
   <td>{{CompatNo}}</td>
   <td>{{CompatGeckoDesktop("17.0")}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>mozLoadFrom()</code> {{obsolete_inline(24)}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatGeckoDesktop("1.9.2")}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>mozSrcObject</code> property {{non-standard_inline}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatGeckoDesktop("18.0")}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>initialTime</code> property {{non-standard_inline}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatGeckoDesktop("9.0")}}[4]</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>fastSeek</code> method</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatGeckoDesktop("31.0")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>startDate</code> property</td>
   <td>{{CompatUnknown}}</td>
   <td>{{ CompatNo}}[8]</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>mediaGroup</code> and <code>controller</code> properties</td>
   <td>{{CompatUnknown}}</td>
   <td>{{ CompatNo}}[9]</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>audioTracks</code>, and <code>videoTracks</code> properties</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatGeckoDesktop("33.0")}} [5]</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>textTracks</code> property</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatNightly}} [6]</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>sinkId</code>&nbsp;property and&nbsp;<code>setSinkId()</code>&nbsp;method</td>
   <td>{{CompatChrome(49.0)}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>seekToNextFrame()</code> method</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatGeckoDesktop(49)}} [10]</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td>srcObject</td>
   <td>{{CompatChrome(52.0)}}</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>39</td>
   <td>&nbsp;</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Android Webview</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>Firefox OS (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
   <th>Chrome for Android</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>buffered</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile("2.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>defaultMuted</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile("11.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>loop</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile("11.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>seekable</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile("8.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>defaultPlaybackRate</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile("20.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>playbackRate</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile("20.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>preservesPitch</code> property {{non-standard_inline}}</td>
   <td>{{CompatVersionUnknown}}{{property_prefix("webkit")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile("20.0")}}{{property_prefix("moz")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{ CompatNo}}</td>
   <td>{{ CompatNo}}</td>
   <td>{{ CompatNo}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>preload</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile("2.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>played</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile("15.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>crossOrigin</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile("12.0")}}[3]<br />
    {{ CompatGeckoMobile("22.0")}}<br />
    &nbsp;</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>mozAudiochannelType</code></td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>1.0.1</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>mozChannels</code>, <code>mozFrameBufferLength</code>, <code>mozSampleRate</code> properties</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatGeckoMobile("2.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>mozGetMetadata()</code></td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatGeckoMobile("17.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>mozLoadFrom()</code> {{deprecated_inline}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatGeckoMobile("1.9.2")}}[7]</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>mozSrcObject</code> property {{non-standard_inline}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatGeckoMobile("18.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>initialTime</code> property {{non-standard_inline}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatGeckoMobile("9.0")}}[4]</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>fastSeek</code> method</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatGeckoMobile("31.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>startDate</code> property</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{ CompatNo}}[8]</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>mediaGroup</code> and <code>controller</code> properties</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{ CompatNo}}[9]</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>audioTracks</code>, and <code>videoTracks</code> properties</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatGeckoMobile("33.0")}}[5]</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>textTracks</code> property</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatNightly}}[6]</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>sinkId</code> property and <code>setSinkId()</code> method</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatChrome(49.0)}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatChrome(49.0)}}</td>
  </tr>
  <tr>
   <td><code>seekToNextFrame()</code> method</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatGeckoMobile(49)}} [10]</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td>srcObject</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatChrome(52.0)}}</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>39</td>
   <td>&nbsp;</td>
   <td>{{CompatChrome(52.0)}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] The <code>NETWORK_LOADED</code> state was removed to align with the HTML spec in Gecko 2.0 {{geckoRelease(2)}}.</p>

<p>[2] Previously Gecko implemented this as <code>autobuffer</code>.</p>

<p>[3] Gecko implements this in lowercase, i.e. <code>crossorigin</code>.</p>

<p>[4] The feature was removed in Gecko 23.0 {{ geckoRelease("23")}}.</p>

<p>[5] The implementation is hidden behind the <code>media.track.enabled</code> preference.</p>

<p>[6] The implementation is hidden behind the <code>media.webvtt.enabled</code> preference, defaulting there to <code>true</code>.</p>

<p>[7] This feature was removed in {{CompatGeckoMobile("24")}}.</p>

<p>[8] Gecko doesn't implement this yet. See {{bug("847376")}}.</p>

<p>[9] Gecko doesn't implement this yet. See {{bug("847377")}}.</p>

<p>[10] The preference {{pref("media.seekToNextFrame")}} must be enabled to use the {{domxref("HTMLMediaElement.seekToNextFrame", "seekToNextFrame()")}} method.</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>References
  <ul>
   <li>{{HTMLElement("video")}} and {{HTMLElement("audio")}} HTML elements.</li>
   <li>{{domxref("HTMLVideoElement")}} and {{domxref("HTMLAudioElement")}} interfaces, derived from <code>HTMLMediaElement</code>.</li>
  </ul>
 </li>
 <li>Articles
  <ul>
   <li><a class="internal" href="/en-US/docs/Using_HTML5_audio_and_video">Using HTML5 audio and video</a></li>
   <li><a class="internal" href="/en-US/docs/Media_formats_supported_by_the_audio_and_video_elements">Media formats supported by the audio and video elements</a></li>
   <li><a href="/en-US/docs/Web_Audio_API">Web Audio API</a></li>
  </ul>
 </li>
</ul>
Revert to this revision