[whatwg] Scripted querying of <video> capabilities

Robert O'Callahan robert at ocallahan.org
Thu Nov 13 13:14:47 PST 2008


On Fri, Nov 14, 2008 at 8:38 AM, Philip Jägenstedt <philipj at opera.com>wrote:

> I'm also a bit concerned about how to interpret the yes, no and maybe
> return values. The truthful answer is going to be "maybe" for all but
> the obviously unsupporter (application/x-ms-dos-executable) and the more
> trivial formats (audio/wav).
>

Even WAV is extensible.

When asking about application/ogg, this could mean 2 things:
>
> 1. "can I demux Ogg streams?"
> 2. "can I demux Ogg streams and decode unknown codecs?"


It means "can I play this stream, given that the only thing I know about it
is that it's an Ogg stream"? Which I guess is what you meant by option 2.

The browser can only answer "no" or "maybe" in this case. That seems fine to
me. It lets the author know whether the browser can demux Ogg streams, while
staying consistent with the behaviour when codec information is given in the
MIME type.

Unless the codecs parameter is to be made mandatory I think that spec
> should explicitly make it such that the question asked is 1. In either
> case we will end up there because 2 is not a meaningful question and
> user agents will make untruthful answers in attempts to stay compatible
> with unknown and future content (which might be supported by installing
> new codecs in the media framework without upgrading the browser).


I don't understand what the incentives are for browsers to lie. If we start
off telling the truth, then authors will have to write scripts that either
accept "maybe" or, better still, provide the codec information, or their
scripts won't work. I don't see how that would change over time.

Now, if the codec parameter is used then the user agent may answer yes
> and no in a way that actually makes some sense.


Yes. Authors should be strongly encouraged to give the codec parameters.

I also think that this should be explicitly related to the type
> attribute of the source element. One should be able to use canPlayType
> to predict with 100% accuracy which source the user agent will use when
> it encounters.
>
> <video>
> <source type="application/ogg"/>
> <source type="application/ogg codecs=dirac,flac"/>
> </video>
>
> If this isn't specified then one can expect lots of web app authors
> being forced to write scripts to work around the different behaviour of
> canPlayType and the "pick a source" algorithm in different browsers.


I agree.

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20081114/a0526e2e/attachment-0001.htm>


More information about the whatwg mailing list