These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:25 pm Advanced search

Preventing HMTL5 <video> from automatically downloadin

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

Preventing HMTL5 <video> from automatically downloadin

Postby grahams » Fri Sep 04, 2009 1:53 am

I'm excited about the possibilities of the HTML5 <audio> and <video> tags.

However... if I have a number of videos on a page I don't want to waste bandwidth downloading them all to the user when they may not even want to play them.

Do any of you have tips for working around this? Is there a way to only download the content once the play button is pressed?

It's possible in Flash, so why not with HTML5?
grahams
<h6>
 
Posts: 1
Joined: Fri Sep 04, 2009 12:02 am
Location: UK

Postby zcorpan » Thu Sep 17, 2009 7:38 am

If you don't use the autobuffer or autoplay attributes, then HTML5 allows the browser to only download enough data to show the first frame, and then suspend the download until the user plays.

If you use a poster="" image then HTML5 allows the browser to just download the image and wait with downloading any video data until the user plays.

If the browser you're using is not suspending the download, then you should complain to the browser vendor. (I think at least Firefox 3.5 suspends the download.)

If you don't want to wait until browsers have fixed this, you can work around it by using an <img> and swap it for a <video> with script when the user clicks on the image, or similar.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests