STeN
STeN

Reputation: 6268

HTML5 <video> element - buffering size, starting video quickly

is there any way we can specify the buffering data size for the element? Is it somewhere specified how much data/seconds the browser needs to buffer?

I am asking because we need to make the video shown as soon as possible, even if that means cutting the buffer size to absolute minimum...

We do not use any streaming protocol (e.g. HLS). It is simple progressive download of a large video file...

Thanks

STeN

Upvotes: 7

Views: 20909

Answers (1)

Jörn Berkefeld
Jörn Berkefeld

Reputation: 2579

  1. you canNOT change the buffer size of browsers at the current time

  2. simply do the following after the video-element is available to the DOM (i.e. use jQuery's onLoad function to run it)

    myVideo = document.getElementById("myVideoId");
    myVideo.load();
    myVideo.play();
    

    this will start the video as soon as possible - unless you try to serve it on an iOS-device. Apple prohibits autoplay and actually fixed possible workarounds from the past.

Upvotes: 2

Related Questions