mirror of
https://github.com/samsonjs/media.git
synced 2026-04-04 11:05:47 +00:00
Don't use toLowerCase :).
It can do weird things if the device has an unusual default Locale. Util.toLowerInvariant uses the US Locale, which does the right thing in this case.
This commit is contained in:
parent
eeb73a86ea
commit
04342f2b76
1 changed files with 5 additions and 4 deletions
|
|
@ -21,6 +21,7 @@ import com.google.android.exoplayer.text.Subtitle;
|
|||
import com.google.android.exoplayer.text.SubtitleParser;
|
||||
import com.google.android.exoplayer.util.MimeTypes;
|
||||
import com.google.android.exoplayer.util.ParserUtil;
|
||||
import com.google.android.exoplayer.util.Util;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.text.Layout;
|
||||
|
|
@ -224,14 +225,14 @@ public final class TtmlParser implements SubtitleParser {
|
|||
break;
|
||||
case TtmlNode.ATTR_TTS_FONT_WEIGHT:
|
||||
style = createIfNull(style).setBold(
|
||||
TtmlNode.BOLD.equals(attributeValue.toLowerCase()));
|
||||
TtmlNode.BOLD.equalsIgnoreCase(attributeValue));
|
||||
break;
|
||||
case TtmlNode.ATTR_TTS_FONT_STYLE:
|
||||
style = createIfNull(style).setItalic(
|
||||
TtmlNode.ITALIC.equals(attributeValue.toLowerCase()));
|
||||
TtmlNode.ITALIC.equalsIgnoreCase(attributeValue));
|
||||
break;
|
||||
case TtmlNode.ATTR_TTS_TEXT_ALIGN:
|
||||
switch (attributeValue.toLowerCase()) {
|
||||
switch (Util.toLowerInvariant(attributeValue)) {
|
||||
case TtmlNode.LEFT:
|
||||
style = createIfNull(style).setTextAlign(Layout.Alignment.ALIGN_NORMAL);
|
||||
break;
|
||||
|
|
@ -250,7 +251,7 @@ public final class TtmlParser implements SubtitleParser {
|
|||
}
|
||||
break;
|
||||
case TtmlNode.ATTR_TTS_TEXT_DECORATION:
|
||||
switch (attributeValue.toLowerCase()) {
|
||||
switch (Util.toLowerInvariant(attributeValue)) {
|
||||
case TtmlNode.LINETHROUGH:
|
||||
style = createIfNull(style).setLinethrough(true);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue