Bug 75154
Summary: | Media tags should choose the best <source>, not the first MaybeSupported one. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ami Fischman <fischman> |
Component: | Media | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | eric.carlson, jer.noble, scherkus |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All |
Ami Fischman
Migrated from http://code.google.com/p/chromium/issues/detail?id=35136
Consider:
<video controls autoplay>
<source src="dirac.ogv" type='video/ogg; codecs="dirac, vorbis"' />
<source src="theora.ogv" type='video/ogg; codecs="theora, vorbis"' />
</video>
Today chromium (for example) will attempt to use the first <source> child (and fail because it doesn't include a dirac decoder).
I think the problem is in HTMLMediaElement::selectNextSourceChild where the iteration among the <source> children of <video> stops as soon as it hits a !IsNotSupported child, instead of looking for a "best" match.
Ideally if an IsSupported child follows a MayBeSupported child, the IsSupported one should be used.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Eric Carlson
(In reply to comment #0)
> Migrated from http://code.google.com/p/chromium/issues/detail?id=35136
>
> Consider:
> <video controls autoplay>
> <source src="dirac.ogv" type='video/ogg; codecs="dirac, vorbis"' />
> <source src="theora.ogv" type='video/ogg; codecs="theora, vorbis"' />
> </video>
>
> Today chromium (for example) will attempt to use the first <source> child (and fail because it doesn't include a dirac decoder).
> I think the problem is in HTMLMediaElement::selectNextSourceChild where the iteration among the <source> children of <video> stops as soon as it hits a !IsNotSupported child, instead of looking for a "best" match.
> Ideally if an IsSupported child follows a MayBeSupported child, the IsSupported one should be used.
Read the spec please! Open http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#concept-media-load-algorithm, read the section starting with "Otherwise, the source elements will be used".
Eric Carlson
Now look at the paragraph that starts with "If the media data can be fetched...".
The problem is that the chromium media engine apparently doesn't call mediaPlayerNetworkStateChanged() with an error before the readyState reaches HAVE_METADATA.
Eric Carlson
(In reply to comment #2)
> The problem is that the chromium media engine apparently doesn't call mediaPlayerNetworkStateChanged() with an error before the readyState reaches HAVE_METADATA.
Or it could return "" to canPlayType("video/ogg; codecs='dirac, vorbis'").
Ami Fischman
Thanks Eric. I foolishly only read 4.8.8 (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#the-source-element) without looking at the explicit algorithm.