- From: Silvia Pfeiffer <silviapfeiffer1@gmail.com>
- Date: Mon, 14 Dec 2009 17:54:28 +1100
Ah that's excellent. I was under the impression that all implementations so far are ignoring the media attribute in the selection algorithm. But it seems I am mistaken. Do all browsers implement this support then? And can we put the examples below into the specification? Indeed it seems to me the solution to the "quality" problem should then be done through the media attribute. I am not sure yet how to, because we have no definition for what a "low quality" or "high quality" video is other than some form or SD vs HD and lower resolution vs higher resolution and lower bandwidth vs higher bandwidth. Regards, Silvia. On Mon, Dec 14, 2009 at 4:12 PM, Eric Carlson <eric.carlson at apple.com> wrote: > > On Dec 13, 2009, at 8:12 PM, Silvia Pfeiffer wrote: > >> Oh! What are you doing with it? I mean - have the values in the media >> attribute any effect on the video element? >> > ?Certainly! WebKit evaluates the query in the 'media' attribute if it believes it can handle the MIME type. If the query evaluates to true, it uses that <source> element. If it evaluates to false it skips it, even though it could (in theory) open the movie. For example, one of our layout tests [1] has the following : > > <video controls> > ? ?<source src=content/error.mpeg media="print"> > ? ?<source src=content/error2.mpeg media="screen and (min-device-width: 80000px)"> > ? ?<source src=content/test.mp4 media="screen and (min-device-width: 100px)"> > </video> > > ?The test fails if the video element is instantiated with anything but "test.mp4". > > ?I have seen 'media' used on real-world pages with something like the following to select different movies for the iphone and desktop: > > <video controls> > ? ?<source src='desktop-video.mp4' media="@media screen and (min-device-width: 481px)"> > ? ?<source src='iphone-video.mp4' media="@media screen and (min-device-width: 480px)"> > </video> > > ?This works because the <source> elements are evaluated in order, so the first one is selected on the desktop where both queries will evaluate to true. > > eric > > [1] http://trac.webkit.org/browser/trunk/LayoutTests/media/video-source-media.html?format=txt > > >> Thanks, >> Silvia. >> >> On Mon, Dec 14, 2009 at 2:43 PM, Eric Carlson <eric.carlson at apple.com> wrote: >>> >>> On Dec 13, 2009, at 2:35 PM, Silvia Pfeiffer wrote: >>> >>>> This is why the @media attribute hasnt' been used/implemented anywhere yet >>>> >>> ?Are you saying that nobody has implemented the "media" attribute on <source>? If so, you are incorrect as WebKit has had this for almost two years. >>> >>> eric >>> >>> > >
Received on Sunday, 13 December 2009 22:54:28 UTC