RESOLVED FIXED 74121
Consider user's preferred language when choosing text tracks
https://bugs.webkit.org/show_bug.cgi?id=74121
Summary Consider user's preferred language when choosing text tracks
Eric Carlson
Reported 2011-12-08 13:15:16 PST
The rules for sourcing out-of-band text tracks require access to the user's preferred language. For example: If the text track kind is subtitles or captions and the user has indicated an interest in having a track with this text track kind, text track language, and text track label enabled, and there is no other text track in the media element's list of text tracks with a text track kind of either subtitles or captions whose text track mode is showing http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#sourcing-out-of-band-text-tracks On OS X, at least, the preference is an ordered list of languages.
Attachments
Proposed patch (38.09 KB, patch)
2012-02-01 14:24 PST, Eric Carlson
ap: review+
Radar WebKit Bug Importer
Comment 1 2011-12-08 13:15:37 PST
Eric Carlson
Comment 2 2012-02-01 14:24:15 PST
Created attachment 125015 [details] Proposed patch
Alexey Proskuryakov
Comment 3 2012-02-01 14:31:28 PST
Comment on attachment 125015 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=125015&action=review > Source/WebCore/html/HTMLMediaElement.cpp:2365 > + // ... ? > Source/WebCore/platform/Language.cpp:93 > + if (lowercaseLanguageCode.length() >= 3 && lowercaseLanguageCode[2] == '_') > + lowercaseLanguageCode.replace(2, 1, "-"); Don't we want to use CoreFoundation to canonicalize? AppleLanguages can contains things like "English" on some systems.
Eric Carlson
Comment 4 2012-02-01 14:46:56 PST
(In reply to comment #3) > (From update of attachment 125015 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=125015&action=review > > > Source/WebCore/html/HTMLMediaElement.cpp:2365 > > + // ... > > ? I was tryingo indicate that the text is not the first thing after the section label. I can remove it if it is confusing. > > > Source/WebCore/platform/Language.cpp:93 > > + if (lowercaseLanguageCode.length() >= 3 && lowercaseLanguageCode[2] == '_') > > + lowercaseLanguageCode.replace(2, 1, "-"); > > Don't we want to use CoreFoundation to canonicalize? AppleLanguages can contains things like "English" on some systems. Maybe. This is how we canonicalize language codes returned by AppleLanguages in createHTTPStyleLanguageCode (Languages.mm). Do you know if we have had an reports of problems with that code? Thanks for the quick review!
Alexey Proskuryakov
Comment 5 2012-02-01 16:33:17 PST
> Maybe. This is how we canonicalize language codes returned by AppleLanguages in createHTTPStyleLanguageCode (Languages.mm). Do you know if we have had an reports of problems with that code? No, none that I would remember.
Eric Carlson
Comment 6 2012-02-01 21:12:10 PST
(In reply to comment #5) > > Maybe. This is how we canonicalize language codes returned by AppleLanguages in createHTTPStyleLanguageCode (Languages.mm). Do you know if we have had an reports of problems with that code? > > No, none that I would remember. OK, lets keep an eye out and problem show up I will add a platform specific version.
Eric Carlson
Comment 7 2012-02-01 21:12:25 PST
Note You need to log in before you can comment on or make changes to this bug.