WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
75154
Media tags should choose the best <source>, not the first MaybeSupported one.
https://bugs.webkit.org/show_bug.cgi?id=75154
Summary
Media tags should choose the best <source>, not the first MaybeSupported one.
Ami Fischman
Reported
2011-12-22 17:15:23 PST
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
Comment 1
2011-12-22 21:49:19 PST
(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
Comment 2
2011-12-22 21:57:20 PST
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
Comment 3
2011-12-22 22:08:07 PST
(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
Comment 4
2011-12-22 22:29:47 PST
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.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug