Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Change bufferlength dynamically

9 replies [Last post]
Reply

Can the bufferlength be changed once the video is loaded? I'd like to be able to keep it short for the initial load, so as to reduce any lag time a user might experience in waiting the fir the video to begin. But then once it's playing, I want to increase it to reduce the need for rebuffering as network conditions fluctuate.

Can this be done using the existing Javascript API? If not, could it be done using a plugin API?

Thanks,
Larry

Reply

 
Here are a couple of Buffer plugins for you to play around with.

    http://willswonders.myip.org:5081/buffer.swf

    http://willswonders.myip.org:5081/buffer-test.swf

buffer-test.swf displays the current bufferlength in the lower-left corner of the displayarea.

Both plugins accept two flashvars:

'buffer.initialinterval':  '15', // default: 10
'buffer.bufferlength':     '15', // default: 10

buffer.initialinterval is the initial interval during which the player will use the bufferlength which is set in the player's flashvars or the default of 1.
buffer.bufferlength is the bufferlength that will be used after the initial interval.

That's all!

Reply

Very helpful. Thank you!

Are these compatible with 5.x only? (they seem to be)

Reply

 
Yes, the plugins are v5 only.

After doing a lot of experimenting, I don't think that the plugin does what you want. That is, increase the buffered amount on a continuing stream.

The buffered amount only seems to change when switching to another track.

I came to this conclusion after watching the bandwidth usage.

On initial startup, as the player is filling the buffer, the bandwidth usage is high, then drops down after the buffer is filled. When the bufferlength changes, I don't see an increased bandwidth usage to fill the larger buffer; the bandwidth usage continues along at the reduced level necessary to keep up with the usage.

I don't know enough about the player's inner workings to know where and if it's even possible to change the buffer while the stream is continuing to play.

Reply

Do not tell from where you can download buffer.swf?

Reply

Buffer.swf is not a file that you download, there is no such file.

Reply

I'm having the same problem - some videos (if they are longer ones) buffer a very long time before they start playing. Is there any way that the video starts, say, after buffering 5 seconds? I've tried to change "bufferlength" but nothing happens. Here's my code:

<script type="text/javascript">
jwplayer("thePlayer").setup({
flashplayer: "jwplayer/player.swf",
file: "http://www.eventdj.de/film/ncb_2011_neu.mp4",
image: "http://www.eventdj.de/film/ncb_2011_neu.jpg",
height: "283",
width: "502",
controlbar: "none",
bufferlength: "1",
autostart: "true"
});
</script>

Thanks!

Reply

Btw, using the code from your setup wizards results in a white space and nothing happening...

<script type='text/javascript' src='swfobject.js'></script>

<div id='mediaspace'>This text will be replaced</div>

<script type='text/javascript'>
var so = new SWFObject('http://www.eventdj.de/film/ncb_2011_neu.mp4','mpl','502','288','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('file','http://www.eventdj.de/film/ncb_2011_neu.mp4');
so.addVariable('image','http://www.eventdj.de/film/ncb_2011_neu.jpg');
so.addVariable('bufferlength','1');
so.addVariable('controlbar','none');
so.addVariable('autostart','true');
so.addVariable('icons','false');
so.write('mediaspace');
</script>

Reply

(of course I changed the first line to the right path:

<script type='text/javascript' src='jwplayer/swfobject.js'></script>

Reply

 
Use MP4Box or a similar tool to move the boxes to the beginning of your MP4 file so it will start almost immediately.
 

 
MP4Box -inter 0.5 yourvideofilename.mp4
 

Post new comment

  • Allowed HTML tags: <code> <blockquote> <em> <strong> <strike> <ul> <li> <ol>
  • You may post code using <code>...</code> .
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options