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

On Thu, Jul 9, 2009 at 9:22 PM, Maciej Stachowiak<mjs at apple.com> wrote:

> I think at one point I suggested that canPlayType should return one of
> boolean false, true or "maybe", so that naiive boolean tests would work. Or
> in any case, make the "no" option something that tests as boolean false.

We seem to have wound up with a tristate where one of the states is
never used, which is unfortunate. Is it too late now?

To recap (off the top of my head): it's hard to say if you can play
something because that requires either a validator, or actually
playing it, So in addition to 'yes' and 'no', a 'maybe' was added, to
say "I've heard of the media type and codecs and profiles, so it's
worth trying; no promises."

But the whole idea of canPlayType is to be a lightweight test do
decide what to try playing in advance, so browsers are unlikely to
implement a check that involves actually loading and testing the
resource. So in practice 'yes' would only be returned in special
applications, not for general web resources. 'No' means no, 'maybe'
means yes and 'yes' never gets used.

It will be confusing either way, but if canPlayType were reverted to a
boolean, with a note that true means 'maybe', not 'yes', there would
at least be fewer programming errors.

But Ian's just replied with a clever compromise.

 -r

Received on Thursday, 9 July 2009 21:40:29 UTC