videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
38.11k stars 7.46k forks source link

HTML5: Player does not wait for tracks to be loaded to start #3018

Open Naouak opened 8 years ago

Naouak commented 8 years ago

Player will start playback in autoplay (and if play is manually requested) even if current actived track is not loaded. Track could end up not appearing or cues start appearing too late.

Test case:

  1. Create a server with a several seconds delay when loading vtt files ( using setTimeout in node.js for example).
  2. Use the delayed loading file in an autoplay player as default track.

A solution would be to wait for tracks loading to start the play. Adding a tracksloading state could trigger the load spinner and play action of the tech could wait for the loading of the tracks to start playing.

There is a workaround to find for mobile browser since you can only start a video in a DOM event handler.

gkatsev commented 8 years ago

I'm not sure we want to do this, at least not by default. The browsers don't wait for tracks to be loaded before letting you play back the video.

At best, this can be made as an option that's turned off by default.