W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2012

[whatwg] <source> media attribute behavior, static or dynamic ?

From: Paul Adenot <padenot+whatwg@mozilla.com>
Date: Thu, 10 May 2012 14:03:15 -0700
Message-ID: <4FAC2D13.2040703@mozilla.com>
To: whatwg@whatwg.org
Currently implementing the media attribute of the source element in 
Gecko, we are unsure about what the specification requires us to do there.

Considering this example :

<video>
   <source src="lowres.webm" media="max-width:500px">
   <source src="highres.webm">
</video>

what is the expected behavior of a page containing such code being 
loaded, in a page that is 1000px width, and then being resized to be 
under 500px?

Should the media currently playing change? Is the media attributes and 
the multiple <source> attribute only taken into account when the page is 
loaded?

The spec [1] says :

 > Dynamically modifying a source element and its attribute when the
 > element is already inserted in a video or audio element will have no
 > effect. To change what is playing, just use the src attribute on the
 > media element directly, possibly making use of the canPlayType()
 > method to pick from amongst available resources. Generally,
 > manipulating source elements manually after the document has been
 > parsed is an unncessarily complicated approach.

which seems to indicate that the <source> element are only used at load 
time. Since |canPlayType()| is mentioned, |matchMedia()| is possibly the 
right approach here, but it is unclear to us what the spec exactly 
requires. We think the spec needs clarification here.

Thanks,
Paul.
Received on Thursday, 10 May 2012 21:04:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:08 GMT