Commit b15ceba7 by olly Committed by Oliver Woodman

Enhance DefaultTrackSelector part 2

- Support specifying a preferred text language.
- Score based selection for text/audio/other tracks.
- Prefer default tracks to non-default ones.
- Allow overriding of base select*Track methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129626994
parent 95f41134
......@@ -240,6 +240,16 @@ public final class Util {
}
/**
* Returns a normalized RFC 5646 language code.
*
* @param language A possibly non-normalized RFC 5646 language code.
* @return The normalized code, or null if the input was null.
*/
public static String normalizeLanguageCode(String language) {
return language == null ? null : new Locale(language).getLanguage();
}
/**
* Returns a new byte array containing the code points of a {@link String} encoded using UTF-8.
*
* @param value The {@link String} whose bytes should be obtained.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment