View Full Version : HTML5 Video - Start buffering on page load

12-16-2011, 06:27 PM

From my experience with HTML5 video so far (which isn't much), Firefox seems to switching to the "HAVE_ENOUGH_DATA" state too soon which is causing very choppy playback while the video is buffering. Is there a way to start the loading of video as soon as the page loads instead of waiting for the user to press play? I don't mean "autoplay", I want the video to start buffering as soon as the page loads without it playing.

Thank you.

12-17-2011, 06:25 PM
HAVE_ENOUGH_DATA is just an estimate, so there's always a chance it might be off. Firefox changed that estimate to a less conservative one a while ago (see https://bugzilla.mozilla.org/show_bug.cgi?id=627153), and that might be what you're seeing here.

Anyway, use the preload attribute to start buffering immediately. Some browsers might use the autobuffer attribute instead, which has been in the specs originally but has been replaced by preload.

12-17-2011, 08:12 PM
Thanks venegal, you solved my problem. Preload works perfectly.