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 901961 of HTMLMediaElement.playbackRate

  • Revision slug: Web/API/HTMLMediaElement/playbackRate
  • Revision title: HTMLMediaElement.playbackRate
  • Revision id: 901961
  • Created:
  • Creator: markg
  • Is current revision? No
  • Comment add content and tags

Revision Content

{{APIRef("HTML DOM")}}

The HTMLMediaElement.playbackRate property sets the playback rate for the media.

Syntax

var dSpeed = video.playbackRate;
audio.playbackRate = 1.0;

Value

A double. 1.0 is "normal speed," values lower than 1.0 make the media play slower than normal, higher values make it play faster. The value 0.0 is invalid and throws a NOT_SUPPORTED_ERR exception.

Example

var obj = document.createElement('video');
console.log(obj.playbackRate); // 1

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', "the-video-element.html#htmlmediaelement", "HTMLMediaElement.playbackRate")}} {{Spec2('HTML WHATWG')}} No change from {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', "embedded-content-0.html#htmlmediaelement", "HTMLMediaElement.playbackRate")}} {{Spec2('HTML5 W3C')}} Initial definition.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
playbackRate property {{CompatVersionUnknown}} {{CompatGeckoDesktop("20.0")}} {{CompatIE("9")}} {{CompatUnknown}} {{CompatUnknown}}
Feature Android Firefox Mobile (Gecko) Firefox OS (Gecko) IE Mobile Opera Mobile Safari Mobile
defaultPlaybackRate property {{CompatVersionUnknown}} {{CompatGeckoMobile("20.0")}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

See also

  • The interface defining it, {{domxref("HTMLMediaElement")}}.

Revision Source

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

<p>The <strong><code>HTMLMediaElement.playbackRate</code></strong> property sets&nbsp;the playback rate for the media.</p>

<h2 id="Syntax" name="Syntax">Syntax</h2>

<pre class="syntaxbox">
var <em>dSpeed</em> = <em>video</em>.playbackRate;
<em>audio</em>.playbackRate = 1.0;
</pre>

<h3 id="Value">Value</h3>

<p>A double. 1.0 is "normal speed," values lower than 1.0 make the media play slower than normal, higher values make it play faster. The value 0.0 is invalid and throws a <code>NOT_SUPPORTED_ERR</code> exception.</p>

<h2 id="Example">Example</h2>

<pre class="syntaxbox">
var obj = document.createElement('video');
console.log(obj.playbackRate); // 1
</pre>

<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.playbackRate")}}</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.playbackRate")}}</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><code>playbackRate</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("20.0")}}</td>
   <td>{{CompatIE("9")}}</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>Firefox OS (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td><code>defaultPlaybackRate</code> property</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile("20.0")}}</td>
   <td>{{CompatVersionUnknown}}</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>The interface defining it, {{domxref("HTMLMediaElement")}}.</li>
</ul>
Revert to this revision