Video defaultPlaybackRate attribute

Definition and usage

defaultPlaybackRate attribute settings or return the default playback speed of the video.

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

Example

Example 1

Set the video to play in slow motion by default:

document.getElementById("myVideo").defaultPlaybackRate = 0.5;

Try it yourself

Example 2

Set the video to play faster by default:

document.getElementById("myVideo").defaultPlaybackRate = 5;

Try it yourself

Syntax

Return the defaultPlaybackRate attribute:

videoObject.defaultPlaybackRate

Set the defaultPlaybackRate attribute:

videoObject.defaultPlaybackRate = number

Attribute value

Value Description
number

Represents the default playback speed of the video.

Example values:

  • 1.0 is the normal speed
  • 0.5 is half speed (slower)
  • 2.0 is double speed (faster)
  • -1.0 is backward, normal speed
  • -0.5 is backward, half speed

Note:Value 0.0 is invalid and throws a NOT_SUPPORTED_ERR exception.

Technical Details

Return Value: A number representing the default playback speed.
Default Value: 1.0

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Supported 9.0 Supported Not Supported Supported