7

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

STeN
  • 6,262
  • 22
  • 80
  • 125
  • If you want stuff to download faster, make it smaller. – robertc Dec 05 '11 at 15:39
  • We are on private WiFi network, which is pretty fast - I wanted more to lower the initial buffer size, but seems to not be possible. having the worse video is not an option for us. – STeN Dec 06 '11 at 04:29
  • What exactly do you mean by "make the video shown as soon as possible"? Ensure that it can be played? Or do you start playing it automatically? – Ian Devlin Dec 05 '11 at 13:09
  • 1
    The browser has some initial buffer, that is filled by video data before the video is played - my question was if we can manipulate the initial buffer size to make the video start as soon as first frames can be decoded, not waiting until e.g. 5 seconds of data are pre-buffered. – STeN Dec 06 '11 at 04:31

1 Answers1

2
  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.

Jörn Berkefeld
  • 2,540
  • 20
  • 31
  • Hi, what I am doing is that as soon as DOM is avialable I call: `this.player.src = this.movieUrl;this.player.load(); this.player.play();`, so it seems I cannot be faster... Thanks – STeN Dec 06 '11 at 04:28
  • you could skip the this.player.src command with server-side scripting to further increase the speed (set the src directly in the video-tag, e.g. via PHP). oh, and don't wait for the DOM to be ready. include your javascript-function with (this.player.load(); this.player.play();) right below the video-element – Jörn Berkefeld Dec 07 '11 at 09:19
  • come to think of it, you might wanna add the attribute "preload" as well via server-side scripting. that should start the download before DOM-ready – Jörn Berkefeld Dec 07 '11 at 09:21