W3C home > Mailing lists > Public > public-html-comments@w3.org > October 2009

Re: Video DOM API

From: Gervase Markham <gerv@gerv.net>
Date: Thu, 08 Oct 2009 13:53:59 +0100
Message-ID: <4ACDE0E7.6000801@gerv.net>
To: Simon Pieters <simonp@opera.com>, public-html-comments@w3.org
On 08/10/09 13:29, Simon Pieters wrote:
> Maybe we could remove the networkState check when the src attribute is
> set or changed. Should the "in a Document" check be removed, too? That
> is, do you want to be able to do
>
> var a = new Audio('foo');
> a.play();
> a.onended = function() { a.src = 'bar'; a.onended = null; }

That seems like the obvious way one would implement the chaining of 
videos, isn't it? Although it doesn't allow for pre-loading and 
therefore seamless linking unless you've loaded 'bar' in another <audio> 
somewhere else previously. Hmm...

I think I want to be able to do:

var a = new Audio('foo');
a.play();
a.src = 'bar';
a.load();
a.onended = function() { a.play(); a.onended = null; }

which gives me the preloading as well without needing an extra element.

> What do you think should happen when using <source> elements?

Good question. I think that if I add a <source> element, it should be 
automatically load()ed. But if I call play(), then the resource 
selection algorithm should be used at that point to tell which video 
actually plays.

Gerv
Received on Thursday, 8 October 2009 12:54:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 1 June 2011 00:14:00 GMT