Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Preloading (aka prebuffering) downloaded videos & youtube videos


I am developing an application, where timing is very critical . . . (briefly, its a web-based synced instructional mixed media player). The html for the application will have multiple videos, each in their own hidden div, each with their own jw player. When a video's turn in the presentation comes up, its div will be unhidden and I will start playing it via the javscript API. Some videos will be hosted by me on AWS CloudFront (download mode) and others will come from YouTube (with other sources to be added).

Ideally, all the content (or at least the first video or two) will be fully buffered before I start the presentation, even if this takes a few minutes. This is becaues buffering mid-play will cause my timing to get off. (trust me, it matters in this case).

Its not clear from the documentation how pre-loading (aka prebuffering) works with JWPlayer--whether I need to invoke something to cause each player to fully buffer before playing or if this happens automatically. So I'm looking for some tips here.

Do I need to invoke something via javascript for the players on my page to have them buffer the videos (without actually starting playback)?

What about the YouTube videos? Is there any way to get those to prebuffer so I can start playback instantly?

I'm assuming that to detect when a buffer is full, i'll just use onBufferChange(callback) and check for the bufferPercent attribute getting to 100.


BTW, JW PLayer is awesome! Started down the path of FlowPlayer but then checked out JW Player and noticed the support for youtube and HTML5 and was sold.

Thanks,

Ben

3 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Hi Ben, I’m afraid that a video has to begin playback for it to begin buffering. You might be able to play the video for one second, and then pause it, though, which would allow for it to continue buffering.

You would have onReady set, then make the player play, then pause again – http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12540/javascript-api-reference

JW Player

User  
0 rated :

Thanks, Ethan!

Based on your suggestion, what I think I'll do is this: play the videos for 1 second on mute to get them to start buffering, and then when its time to play, turn the volume on, and do a seek(0) .

I'm assuming this will work since they are hidden to begin with anyhow, and I should be able to mute them for that one second so people aren't wtf'ing.

I'll post back if I run into any issues or if things don't go as planned.


Thanks for the fast response! Longtail = Awesome

Ethan Feldman

JW Player Support Agent  
0 rated :

Np! :)

This question has received the maximum number of answers.