Accessing duration attribute of a video DOM object

Another option is to use video.onloadeddata

Example - https://playground.babylonjs.com/#EKFLA#310

I believe it will work a bit faster.
The order of events for the video element:

  1. loadstart
  2. durationchange
  3. loadedmetadata
  4. loadeddata
  5. progress
  6. canplay
  7. canplaythrough
2 Likes