[whatwg] Serving up Theora <video> in the real world

2009/7/9 Michael A. Puls II <shadow2531 at gmail.com>

> On Thu, 09 Jul 2009 19:10:08 -0400, Maciej Stachowiak <mjs at apple.com>
> wrote:
>
>
>> On Jul 9, 2009, at 3:34 PM, Peter Kasting wrote:
>>
>>  On Thu, Jul 9, 2009 at 3:30 PM, Aryeh Gregor <Simetrical
>>> +w3c at gmail.com> wrote:
>>> On Thu, Jul 9, 2009 at 10:04 PM, David Gerard<dgerard at gmail.com>
>>> wrote:
>>> > Really? I thought that was next Chrome, not this Chrome.
>>>
>>> It works in the developer version:
>>>
>>> http://dev.chromium.org/getting-involved/dev-channel
>>>
>>> For any site author needing a UA sniffing route to determine whether
>>> a visitor's Chrome version supports <video>, just look for version
>>> 3.x or higher.
>>>
>>
>> I'd recommend using feature testing or fallback instead though, if you
>> can make that work for your site.
>>
>
> Just to add:
>
> For detecting video support via JS, I suggest feature testing for
> window.HTMLVideoElement (and optionally window.HTMLAudioElement and
> window.HTMLMediaElement).
>
> You indeed can't really go by UA string sniffing as what if I use UserJS to
> make HTMLVideoElement and HTMLAudioElement aliases to HTMLUnknownElement,
> HTMLMediaElement equal to {} and use Getters/Setters and prototypes to
> provide an HTMLMediaElement API proxy to a child <object> that loads the
> VideoLan plug-in (for example, which is scriptable and can play Theora and
> others)?
>
> In that case, I wouldn't want to have to also spoof the UA (via HTTP
> User-Agent and JS's navigator.userAgent etc.) just to get the right code on
> the page.
>
> I already see that <http://openvideo.dailymotion.com/> and <
> http://youtube.com/html5> are using lousy UA string detection. There is
> some use of fallback for <video>, but for the JS code that calls stuff like
> video.play() etc., UA string detection is used, which makes things too
> brittle and makes it so any new browser that supports <video> has to wait
> for the UA detection to get updated.
>
> I think I saw a recent Jquery <video>/<audio> plug-in though that doesn't
> use any UA string detection, which is good.
>
> --
> Michael
>

To me, this seems like a great test if "canPlayType" actually works in
practice. In the perfect world, it would be great to do
getElementById('video'), createElement, and
then canPlayType('video/whatever','theora').

If this simple use case doesn't work, I would ask if it's even worth
keeping canPlayType in the spec.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090709/e0e4e385/attachment-0001.htm>

Received on Thursday, 9 July 2009 17:55:45 UTC