mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Move text classes from lib-exoplayer to lib-extractor and lib-common
PiperOrigin-RevId: 398247348
This commit is contained in:
parent
59cd783dd4
commit
f2a027e068
65 changed files with 8 additions and 8 deletions
|
|
@ -15,7 +15,6 @@
|
||||||
*/
|
*/
|
||||||
package com.google.android.exoplayer2.text.webvtt;
|
package com.google.android.exoplayer2.text.webvtt;
|
||||||
|
|
||||||
import static com.google.android.exoplayer2.text.span.SpanUtil.addOrReplaceSpan;
|
|
||||||
import static java.lang.Math.min;
|
import static java.lang.Math.min;
|
||||||
import static java.lang.annotation.RetentionPolicy.SOURCE;
|
import static java.lang.annotation.RetentionPolicy.SOURCE;
|
||||||
|
|
||||||
|
|
@ -39,6 +38,7 @@ import androidx.annotation.Nullable;
|
||||||
import com.google.android.exoplayer2.text.Cue;
|
import com.google.android.exoplayer2.text.Cue;
|
||||||
import com.google.android.exoplayer2.text.span.HorizontalTextInVerticalContextSpan;
|
import com.google.android.exoplayer2.text.span.HorizontalTextInVerticalContextSpan;
|
||||||
import com.google.android.exoplayer2.text.span.RubySpan;
|
import com.google.android.exoplayer2.text.span.RubySpan;
|
||||||
|
import com.google.android.exoplayer2.text.span.SpanUtil;
|
||||||
import com.google.android.exoplayer2.text.span.TextAnnotation;
|
import com.google.android.exoplayer2.text.span.TextAnnotation;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Log;
|
import com.google.android.exoplayer2.util.Log;
|
||||||
|
|
@ -662,7 +662,7 @@ public final class WebvttCueParser {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (style.getStyle() != WebvttCssStyle.UNSPECIFIED) {
|
if (style.getStyle() != WebvttCssStyle.UNSPECIFIED) {
|
||||||
addOrReplaceSpan(
|
SpanUtil.addOrReplaceSpan(
|
||||||
spannedText,
|
spannedText,
|
||||||
new StyleSpan(style.getStyle()),
|
new StyleSpan(style.getStyle()),
|
||||||
start,
|
start,
|
||||||
|
|
@ -676,7 +676,7 @@ public final class WebvttCueParser {
|
||||||
spannedText.setSpan(new UnderlineSpan(), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
spannedText.setSpan(new UnderlineSpan(), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
}
|
}
|
||||||
if (style.hasFontColor()) {
|
if (style.hasFontColor()) {
|
||||||
addOrReplaceSpan(
|
SpanUtil.addOrReplaceSpan(
|
||||||
spannedText,
|
spannedText,
|
||||||
new ForegroundColorSpan(style.getFontColor()),
|
new ForegroundColorSpan(style.getFontColor()),
|
||||||
start,
|
start,
|
||||||
|
|
@ -684,7 +684,7 @@ public final class WebvttCueParser {
|
||||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
}
|
}
|
||||||
if (style.hasBackgroundColor()) {
|
if (style.hasBackgroundColor()) {
|
||||||
addOrReplaceSpan(
|
SpanUtil.addOrReplaceSpan(
|
||||||
spannedText,
|
spannedText,
|
||||||
new BackgroundColorSpan(style.getBackgroundColor()),
|
new BackgroundColorSpan(style.getBackgroundColor()),
|
||||||
start,
|
start,
|
||||||
|
|
@ -692,7 +692,7 @@ public final class WebvttCueParser {
|
||||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
}
|
}
|
||||||
if (style.getFontFamily() != null) {
|
if (style.getFontFamily() != null) {
|
||||||
addOrReplaceSpan(
|
SpanUtil.addOrReplaceSpan(
|
||||||
spannedText,
|
spannedText,
|
||||||
new TypefaceSpan(style.getFontFamily()),
|
new TypefaceSpan(style.getFontFamily()),
|
||||||
start,
|
start,
|
||||||
|
|
@ -701,7 +701,7 @@ public final class WebvttCueParser {
|
||||||
}
|
}
|
||||||
switch (style.getFontSizeUnit()) {
|
switch (style.getFontSizeUnit()) {
|
||||||
case WebvttCssStyle.FONT_SIZE_UNIT_PIXEL:
|
case WebvttCssStyle.FONT_SIZE_UNIT_PIXEL:
|
||||||
addOrReplaceSpan(
|
SpanUtil.addOrReplaceSpan(
|
||||||
spannedText,
|
spannedText,
|
||||||
new AbsoluteSizeSpan((int) style.getFontSize(), true),
|
new AbsoluteSizeSpan((int) style.getFontSize(), true),
|
||||||
start,
|
start,
|
||||||
|
|
@ -709,7 +709,7 @@ public final class WebvttCueParser {
|
||||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
break;
|
break;
|
||||||
case WebvttCssStyle.FONT_SIZE_UNIT_EM:
|
case WebvttCssStyle.FONT_SIZE_UNIT_EM:
|
||||||
addOrReplaceSpan(
|
SpanUtil.addOrReplaceSpan(
|
||||||
spannedText,
|
spannedText,
|
||||||
new RelativeSizeSpan(style.getFontSize()),
|
new RelativeSizeSpan(style.getFontSize()),
|
||||||
start,
|
start,
|
||||||
|
|
@ -717,7 +717,7 @@ public final class WebvttCueParser {
|
||||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
break;
|
break;
|
||||||
case WebvttCssStyle.FONT_SIZE_UNIT_PERCENT:
|
case WebvttCssStyle.FONT_SIZE_UNIT_PERCENT:
|
||||||
addOrReplaceSpan(
|
SpanUtil.addOrReplaceSpan(
|
||||||
spannedText,
|
spannedText,
|
||||||
new RelativeSizeSpan(style.getFontSize() / 100),
|
new RelativeSizeSpan(style.getFontSize() / 100),
|
||||||
start,
|
start,
|
||||||
Loading…
Reference in a new issue