Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML Audio/Video DOM defaultPlaybackRate Property

HTML Audio/Video DOM defaultPlaybackRate Property

HTML audio/video Tag Reference HTML Audio/Video DOM Reference

Example

Set the video to play at a low speed by default:

myVid=document.getElementById("video1");

myVid.defaultPlaybackRate=0.5;

Try it »


Definition and Usage

The defaultPlaybackRate property sets or returns the default playback speed of the audio/video.

Setting this attribute only changes the default playback speed, not the current one. To change the current playback speed, use playbackRate attribute.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Only Internet Explorer 10, Firefox, and Chrome support the defaultPlaybackRate property.

**Note:** Safari, Opera, or Internet Explorer 9 and earlier versions do not support the defaultPlaybackRate property.


Syntax

Set the defaultPlaybackRate attribute:

audio|video

.defaultPlaybackRate=

playbackspeed

Return the defaultPlaybackRate attribute:

audio|video

.defaultPlaybackRate

Attribute values

Value Description
playbackspeed Indicates the default playback speed of the audio/video.
 例值:     
  • 1.0 normal speed
  • 0.5 half speed (slower)
  • 2.0 double speed (faster)
  • -1.0 backward, normal speed
  • -0.5 backward, half speed
  • |

    Technical Details

    Return Value: Numeric value, the default playback speed
    Default value: 1.0

    HTML audio/video Tag Reference HTML Audio/Video DOM Reference