[whatwg] Author control over media preloading/buffering

Ian Hickson ian at hixie.ch
Mon Feb 23 03:16:14 PST 2009


On Wed, 11 Feb 2009, Robert O'Callahan wrote:
>
> When a media element loads, reaches the HAVE_CURRENT_DATA state, but is 
> paused, and 'autoplay' is not set, we have to decide whether to keep 
> downloading data or not. If we expect the user to play the stream, we 
> should keep downloading and buffering data to minimize the chance that 
> buffering will be needed during playback. But if we don't expect the 
> user to play the stream, we should pause the download to conserve 
> resources. The latter is especially important on pages with large 
> numbers of media elements, only one or two of which the user will play.
> 
> In general it's hard to see how to make a good guess automatically. If a 
> page has one (non-autoplay) media element on it, it's hard to know 
> whether the user is expected or not expected to play it. For example the 
> user might be expected to play it, but only after they've read some text 
> before the video (so autoplay is not appropriate). I think (but I'm not 
> sure) that authors are likely to be able to make better guesses, so I 
> think it would be useful to provide authors with control over this 
> decision. I think that authors are likely to want this control in the 
> same way they like to be able to preload images.
> 
> So, how about adding an "autobuffer" attribute, which instructs the 
> browser that the user will probably play the video and as much data as 
> possible should be pre-downloaded? By default (when the attribute is not 
> present) the browser would be expected to pause the download after 
> reaching HAVE_CURRENT_DATA if the media element is paused and not 
> 'autoplay'.

I've added this attribute.


On Thu, 12 Feb 2009, timeless wrote:
> 
> if i'm a mobile browser vendor (and I am), and if I expect to use 
> Bluetooth to talk to a cell phone which has high bandwidth costs (and if 
> you're using an n800/n810 tethered to a phone in Canada, this is true), 
> then, i'm not sure I really want web pages to specify things quite like 
> this.

I've made it clear that the browser doesn't have to autobuffer even if the 
attribute is present.


On Fri, 13 Feb 2009, timeless wrote:
> 
> i've seen a lot of places of late which have multiple videos which are 
> expected to play in some sort of sequence.
> 
> just saying 'autobuffer' for all of them would kill my device, but a 
> suggestion of which ones to buffer in order would be helpful.

On Sat, 14 Feb 2009, Robert O'Callahan wrote:
> 
> Perhaps they should use script to add 'autobuffer' to the next video (or 
> just play() it).

That seems to address this use case.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list