Skip to content

Latest commit

 

History

History
7 lines (5 loc) · 385 Bytes

media-duration-property.md

File metadata and controls

7 lines (5 loc) · 385 Bytes

The duration property is available to you on the [[audio]] or [[video]] elements via JavaScript.

This property contains the total duration in milliseconds of the selected media element. This property is only available after the video is loaded with the load method.

document
  .querySelector('audioOrVideoSelector')
  .duration // returns the current playback rate