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

RE: Video DOM API

From: Musgrove, Jason L <J.L.Musgrove2@wlv.ac.uk>
Date: Thu, 8 Oct 2009 23:25:02 +0100
Message-ID: <D7C66F5492F56948BC9244768A3283660B5A22FB@exchange03.unv.wlv.ac.uk>
To: <art@artspad.net>, "Gervase Markham" <gerv@gerv.net>, "Simon Pieters" <simonp@opera.com>, <public-html-comments@w3.org>
If what is being aimed for is the sequential playing of more than one
media item, why not amend the spec such that the appropriate media
element (either <audio> or <video>) be permitted to have child elements
that define a playlist in lieu of a src attribute (which can still be
used if only one media item is to played), and let the browser take care
of the sequencing without the unnecessary addition of script to do this.

Suggested example:

<video>
	<clip src="video1.m4v" />
	<clip src="video2.m4v" />
</video>

The API could then be augmented to include a ".clips" property which
represents a collection of the clip elements, and provides appropriate
methods to manipulate the "playlist".


-----Original Message-----
From: public-html-comments-request@w3.org
[mailto:public-html-comments-request@w3.org] On Behalf Of Arthur
Clifford
Sent: 08 October 2009 22:31
To: 'Gervase Markham'; 'Simon Pieters'; public-html-comments@w3.org
Subject: RE: Video DOM API

Wouldn't it be easier to have play take an optional src parameter?

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

internally play could do this check:
if( inSrc !== src) src=inSrc ... load and play video
else if at end of audio, rewind and play
else play forward from where the playback head is at.

Art C

-----Original Message-----
From: public-html-comments-request@w3.org
[mailto:public-html-comments-request@w3.org] On Behalf Of Gervase
Markham
Sent: Thursday, October 08, 2009 5:54 AM
To: Simon Pieters; public-html-comments@w3.org
Subject: Re: Video DOM API

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


-- 
Scanned by iCritical.
Received on Thursday, 8 October 2009 22:25:42 GMT

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