Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
8 lines (5 sloc) 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