0

I am testing videoJS in a web app in chrome and measurement first buffering time (to start to play) and delay is ok but when I test in a different device, like a tv the delay increases to ~7s.

I am testing only HLS videos and I noticed that fragments are loaded much time early the video finish to play then I am asking if it's possible to start to buffer the second video once the current video is 100% downloaded and then the client does not notice that time delay to playback.

  • Yes you can do that by tapping into the existing video player element and attaching an event called `canplaythrough` on it. For more information on `canplaythrough` you can check https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canplaythrough_event – Sumit Surana Jan 10 '20 at 15:51
  • Interesting, I can use that to start to load a second video. But my other question is, where? in a second player (other video tag)? is not possible to use the same player?. Since the device I am testing has resources limited, I would like prefer not increase in more instances or extra DOM nodes if I can avoid to do it – Pavel Angel Mendoza Villafane Jan 10 '20 at 16:24
  • I tested that event.. not work, it is fired when the first 3 fragments are downloaded and the others continues downloading – Pavel Angel Mendoza Villafane Jan 10 '20 at 17:15
  • Hmm, you can also try the `timeupdate` event (https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/timeupdate_event). Basically you can check if the `total time of video / currentTime` reaches a threshold you can start loading the second video – Sumit Surana Jan 13 '20 at 08:48

0 Answers0