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 764855 of HTMLVideoElement

  • Revision slug: Web/API/HTMLVideoElement
  • Revision title: HTMLVideoElement
  • Revision id: 764855
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment test

Revision Content

{{ APIRef("HTML DOM") }}

The HTMLVideoElement interface provides special properties and methods for manipulating video objects. It also inherits properties and methods of {{domxref("HTMLMediaElement")}} and {{domxref("HTMLElement")}}.

The list of supported media formats vary from one browser to the other.

Inheritance chain

{{InheritanceDiagram(600, 140)}} {{EmbedLiveSample("Inheritance_chain", 600, 140)}}

Properties

Inherits properties from its parent, {{domxref("HTMLMediaElement")}}, and {{domxref("HTMLElement")}}.

{{domxref("HTMLVideoElement.height")}}
Is a {{ domxref("DOMString") }} that reflects the {{ htmlattrxref("height", "video") }} HTML attribute, which specifies the height of the display area, in CSS pixels.
{{domxref("HTMLVideoElement.poster")}}
Is a {{ domxref("DOMString") }} that reflects the {{ htmlattrxref("poster", "video") }} HTML attribute, which specifies an image to show while no video data is available.
{{domxref("HTMLVideoElement.videoHeight")}} {{readonlyInline}}
Returns an unsigned long containing the intrinsic height of the resource in CSS pixels, taking into account the dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the format used by the resource. If the element's ready state is HAVE_NOTHING, the value is 0.
{{domxref("HTMLVideoElement.videoWidth")}} {{readonlyInline}}
Returns an unsigned long containing the intrinsic width of the resource in CSS pixels, taking into account the dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the format used by the resource. If the element's ready state is HAVE_NOTHING, the value is 0.
{{domxref("HTMLVideoElement.width")}}
Is a {{ domxref("DOMString") }} that reflects the {{ htmlattrxref("width", "video") }} HTML attribute, which specifies the width of the display area, in CSS pixels.

Gecko-specific properties

{{domxref("HTMLVideoElement.mozParsedFrames")}} {{readonlyInline}}{{non-standard_inline}}
Returns an unsigned long with the count of video frames that have been parsed from the media resource.
{{domxref("HTMLVideoElement.mozDecodedFrames")}} {{readonlyInline}}{{non-standard_inline}}
Returns an unsigned long with the count of parsed video frames that have been decoded into images.
{{domxref("HTMLVideoElement.mozPresentedFrames")}} {{readonlyInline}}{{non-standard_inline}}
Returns an unsigned long with the count of decoded frames that have been presented to the rendering pipeline for painting.
{{domxref("HTMLVideoElement.mozPaintedFrames")}} {{readonlyInline}}{{non-standard_inline}}
Returns an unsigned long with the count of presented frames which were painted on the screen.
{{domxref("HTMLVideoElement.mozFrameDelay")}} {{readonlyInline}}{{non-standard_inline}}
Returns an double with the time which the last painted video frame was late by, in seconds.
{{domxref("HTMLVideoElement.mozHasAudio")}} {{readonlyInline}}{{non-standard_inline}}
Returns a {{domxref("Boolean")}} indicating if there is some audio associated with the video.

Methods

Inherits methods from its parent, {{domxref("HTMLMediaElement")}}, and {{domxref("HTMLElement")}}.

{{domxref("HTMLVideoElement.getVideoPlaybackQuality()")}} {{experimental_inline}}
Returns a {{domxref("VideoPlaybackQuality")}} objects that contains the current playback metrics.

Specifications

Specification Status Comment
{{SpecName('Media Source Extensions', '#idl-def-HTMLVideoElement', 'Extensions to HTMLVideoElement')}} {{Spec2("Media Source Extensions")}} Added the getVideoPlaybackQuality() method.
{{SpecName('HTML WHATWG', "the-video-element.html#the-video-element", "HTMLAreaElement")}} {{Spec2('HTML WHATWG')}} No change from {{SpecName('HTML5 W3C')}}.
{{SpecName('HTML5 W3C', "embedded-content-0.html#the-video-element", "HTMLAreaElement")}} {{Spec2('HTML5 W3C')}} Initial definition.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatVersionUnknown}} {{ CompatGeckoDesktop("2.0") }} 9.0 10.50 {{CompatVersionUnknown}}
mozParsedFrames mozDecodedFrames mozPresentedFrames mozPaintedFrames mozFrameDelay {{non-standard_inline}} {{CompatNo}} {{ CompatGeckoDesktop("5.0") }} {{CompatNo}} {{CompatNo}} {{CompatNo}}
mozHasAudio {{non-standard_inline}} {{CompatNo}} {{ CompatGeckoDesktop("15.0")}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
getVideoPlaybackQuality(){{experimental_inline}} {{CompatUnknown}} {{ CompatGeckoDesktop("25.0")}}
Behind the media.mediasource.enabled preference, defaulting to false.
{{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{ CompatGeckoMobile("2.0") }} 9.0 {{CompatVersionUnknown}} {{CompatVersionUnknown}}
mozParsedFrames mozDecodedFrames mozPresentedFrames mozPaintedFrames mozFrameDelay {{non-standard_inline}} {{CompatNo}} {{ CompatGeckoMobile("5.0") }} {{CompatNo}} {{CompatNo}} {{CompatNo}}
mozHasAudio {{non-standard_inline}} {{CompatNo}} {{ CompatGeckoMobile("15.0")}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
getVideoPlaybackQuality(){{experimental_inline}} {{CompatUnknown}} {{ CompatGeckoMobile("25.0")}}
Behind the media.mediasource.enabled preference, defaulting to false.
{{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

See also

Revision Source

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

<p>The <strong><code>HTMLVideoElement</code></strong> interface provides special properties and methods for manipulating video objects. It also inherits properties and methods of {{domxref("HTMLMediaElement")}} and {{domxref("HTMLElement")}}.</p>

<p>The list of <a href="/en-US/docs/HTML/Supported_media_formats" title="/en-US/docs/HTML/Supported_media_formats">supported media formats</a> vary from one browser to the other.</p>

<h2>Inheritance chain</h2>

<p>{{InheritanceDiagram(600, 140)}} {{EmbedLiveSample("Inheritance_chain", 600, 140)}}</p>

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

<p><em>Inherits properties from its parent, </em><em>{{domxref("HTMLMediaElement")}}, and </em><em>{{domxref("HTMLElement")}}.</em></p>

<dl>
 <dt>{{domxref("HTMLVideoElement.height")}}</dt>
 <dd>Is a {{ domxref("DOMString") }} that reflects the {{ htmlattrxref("height", "video") }} HTML attribute, which specifies the height of the display area, in CSS pixels.</dd>
 <dt>{{domxref("HTMLVideoElement.poster")}}</dt>
 <dd>Is a {{ domxref("DOMString") }} that reflects the {{ htmlattrxref("poster", "video") }} HTML attribute, which specifies an image to show while no video data is available.</dd>
 <dt>{{domxref("HTMLVideoElement.videoHeight")}} {{readonlyInline}}</dt>
 <dd>Returns an <code>unsigned long</code> containing the intrinsic height of the resource in CSS pixels, taking into account the dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the format used by the resource. If the element's ready state is <code>HAVE_NOTHING</code>, the value is <code>0</code>.</dd>
 <dt>{{domxref("HTMLVideoElement.videoWidth")}} {{readonlyInline}}</dt>
 <dd>Returns an <code>unsigned long</code> containing the intrinsic width of the resource in CSS pixels, taking into account the dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the format used by the resource. If the element's ready state is <code>HAVE_NOTHING</code>, the value is <code>0</code>.</dd>
 <dt>{{domxref("HTMLVideoElement.width")}}</dt>
 <dd>Is a {{ domxref("DOMString") }} that reflects the {{ htmlattrxref("width", "video") }} HTML attribute, which specifies the width of the display area, in CSS pixels.</dd>
</dl>

<h3 id="Gecko-specific_properties" name="Gecko-specific_properties">Gecko-specific properties</h3>

<dl>
 <dt>{{domxref("HTMLVideoElement.mozParsedFrames")}} {{readonlyInline}}{{non-standard_inline}}</dt>
 <dd>Returns an <code>unsigned long</code> with the count of video frames that have been parsed from the media resource.</dd>
 <dt>{{domxref("HTMLVideoElement.mozDecodedFrames")}} {{readonlyInline}}{{non-standard_inline}}</dt>
 <dd>Returns an <code>unsigned long</code> with the count of parsed video frames that have been decoded into images.</dd>
 <dt>{{domxref("HTMLVideoElement.mozPresentedFrames")}} {{readonlyInline}}{{non-standard_inline}}</dt>
 <dd>Returns an <code>unsigned long</code> with the count of decoded frames that have been presented to the rendering pipeline for painting.</dd>
 <dt>{{domxref("HTMLVideoElement.mozPaintedFrames")}} {{readonlyInline}}{{non-standard_inline}}</dt>
 <dd>Returns an <code>unsigned long</code> with the count of presented frames which were painted on the screen.</dd>
 <dt>{{domxref("HTMLVideoElement.mozFrameDelay")}} {{readonlyInline}}{{non-standard_inline}}</dt>
 <dd>Returns an <code>double</code> with the time which the last painted video frame was late by, in seconds.</dd>
 <dt>{{domxref("HTMLVideoElement.mozHasAudio")}} {{readonlyInline}}{{non-standard_inline}}</dt>
 <dd>Returns a {{domxref("Boolean")}} indicating if there is some audio associated with the video.</dd>
</dl>

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

<p><em>Inherits methods from its parent, </em><em>{{domxref("HTMLMediaElement")}}, and </em><em>{{domxref("HTMLElement")}}.</em></p>

<dl>
 <dt>{{domxref("HTMLVideoElement.getVideoPlaybackQuality()")}} {{experimental_inline}}</dt>
 <dd>Returns a {{domxref("VideoPlaybackQuality")}} objects that contains the current playback metrics.</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('Media Source Extensions', '#idl-def-HTMLVideoElement', 'Extensions to HTMLVideoElement')}}</td>
   <td>{{Spec2("Media Source Extensions")}}</td>
   <td>Added the <code>getVideoPlaybackQuality()</code> method.</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML WHATWG', "the-video-element.html#the-video-element", "HTMLAreaElement")}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td>No change from {{SpecName('HTML5 W3C')}}.</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', "embedded-content-0.html#the-video-element", "HTMLAreaElement")}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td>Initial definition.</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("2.0") }}</td>
   <td>9.0</td>
   <td>10.50</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>mozParsedFrames mozDecodedFrames mozPresentedFrames mozPaintedFrames mozFrameDelay</code> {{non-standard_inline}}</td>
   <td>{{CompatNo}}</td>
   <td>{{ CompatGeckoDesktop("5.0") }}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>mozHasAudio</code> {{non-standard_inline}}</td>
   <td>{{CompatNo}}</td>
   <td>{{ CompatGeckoDesktop("15.0")}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>getVideoPlaybackQuality()</code>{{experimental_inline}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{ CompatGeckoDesktop("25.0")}}<br />
    Behind the <code>media.mediasource.enabled</code> preference, defaulting to <code>false</code>.</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</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 Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{ CompatGeckoMobile("2.0") }}</td>
   <td>9.0</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>mozParsedFrames mozDecodedFrames mozPresentedFrames mozPaintedFrames mozFrameDelay</code> {{non-standard_inline}}</td>
   <td>{{CompatNo}}</td>
   <td>{{ CompatGeckoMobile("5.0") }}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>mozHasAudio</code> {{non-standard_inline}}</td>
   <td>{{CompatNo}}</td>
   <td>{{ CompatGeckoMobile("15.0")}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
  <tr>
   <td><code>getVideoPlaybackQuality()</code>{{experimental_inline}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{ CompatGeckoMobile("25.0")}}<br />
    Behind the <code>media.mediasource.enabled</code> preference, defaulting to <code>false</code>.</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

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

<ul>
 <li>HTML element implementing this interface: {{ HTMLElement("video") }}.</li>
 <li><a class="external" href="https://people.mozilla.org/~cpearce/paint-stats-demo.html">Demo of video paint statistics</a></li>
 <li><a href="/en-US/docs/HTML/Supported_media_formats" title="/en-US/docs/HTML/Supported_media_formats">Supported media formats</a></li>
</ul>
Revert to this revision