Class WebvttCssStyle
- java.lang.Object
-
- com.google.android.exoplayer2.text.webvtt.WebvttCssStyle
-
@Deprecated public final class WebvttCssStyle extends Object
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.Style object of a CSS style block in a WebVTT file.See the Apply CSS properties section of the W3C specification
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceWebvttCssStyle.FontSizeUnitDeprecated.Font size unit enum.static interfaceWebvttCssStyle.StyleFlagsDeprecated.Style flag enum.
-
Field Summary
Fields Modifier and Type Field Description static intFONT_SIZE_UNIT_EMDeprecated.static intFONT_SIZE_UNIT_PERCENTDeprecated.static intFONT_SIZE_UNIT_PIXELDeprecated.static intSTYLE_BOLDDeprecated.static intSTYLE_BOLD_ITALICDeprecated.static intSTYLE_ITALICDeprecated.static intSTYLE_NORMALDeprecated.static intUNSPECIFIEDDeprecated.
-
Constructor Summary
Constructors Constructor Description WebvttCssStyle()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intgetBackgroundColor()Deprecated.booleangetCombineUpright()Deprecated.intgetFontColor()Deprecated.StringgetFontFamily()Deprecated.floatgetFontSize()Deprecated.@com.google.android.exoplayer2.text.webvtt.WebvttCssStyle.FontSizeUnit intgetFontSizeUnit()Deprecated.@com.google.android.exoplayer2.text.span.TextAnnotation.Position intgetRubyPosition()Deprecated.intgetSpecificityScore(String id, String tag, Set<String> classes, String voice)Deprecated.Returns a value in a score system compliant with the CSS Specificity rules.@com.google.android.exoplayer2.text.webvtt.WebvttCssStyle.StyleFlags intgetStyle()Deprecated.Returns the style orUNSPECIFIEDwhen no style information is given.booleanhasBackgroundColor()Deprecated.booleanhasFontColor()Deprecated.booleanisLinethrough()Deprecated.booleanisUnderline()Deprecated.WebvttCssStylesetBackgroundColor(int backgroundColor)Deprecated.WebvttCssStylesetBold(boolean bold)Deprecated.WebvttCssStylesetCombineUpright(boolean enabled)Deprecated.WebvttCssStylesetFontColor(int color)Deprecated.WebvttCssStylesetFontFamily(String fontFamily)Deprecated.WebvttCssStylesetFontSize(float fontSize)Deprecated.WebvttCssStylesetFontSizeUnit(@com.google.android.exoplayer2.text.webvtt.WebvttCssStyle.FontSizeUnit int unit)Deprecated.WebvttCssStylesetItalic(boolean italic)Deprecated.WebvttCssStylesetLinethrough(boolean linethrough)Deprecated.WebvttCssStylesetRubyPosition(@com.google.android.exoplayer2.text.span.TextAnnotation.Position int rubyPosition)Deprecated.voidsetTargetClasses(String[] targetClasses)Deprecated.voidsetTargetId(String targetId)Deprecated.voidsetTargetTagName(String targetTag)Deprecated.voidsetTargetVoice(String targetVoice)Deprecated.WebvttCssStylesetUnderline(boolean underline)Deprecated.
-
-
-
Field Detail
-
UNSPECIFIED
public static final int UNSPECIFIED
Deprecated.- See Also:
- Constant Field Values
-
STYLE_NORMAL
public static final int STYLE_NORMAL
Deprecated.- See Also:
- Constant Field Values
-
STYLE_BOLD
public static final int STYLE_BOLD
Deprecated.- See Also:
- Constant Field Values
-
STYLE_ITALIC
public static final int STYLE_ITALIC
Deprecated.- See Also:
- Constant Field Values
-
STYLE_BOLD_ITALIC
public static final int STYLE_BOLD_ITALIC
Deprecated.- See Also:
- Constant Field Values
-
FONT_SIZE_UNIT_PIXEL
public static final int FONT_SIZE_UNIT_PIXEL
Deprecated.- See Also:
- Constant Field Values
-
FONT_SIZE_UNIT_EM
public static final int FONT_SIZE_UNIT_EM
Deprecated.- See Also:
- Constant Field Values
-
FONT_SIZE_UNIT_PERCENT
public static final int FONT_SIZE_UNIT_PERCENT
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
setTargetId
public void setTargetId(String targetId)
Deprecated.
-
setTargetTagName
public void setTargetTagName(String targetTag)
Deprecated.
-
setTargetClasses
public void setTargetClasses(String[] targetClasses)
Deprecated.
-
setTargetVoice
public void setTargetVoice(String targetVoice)
Deprecated.
-
getSpecificityScore
public int getSpecificityScore(@Nullable String id, @Nullable String tag, Set<String> classes, @Nullable String voice)Deprecated.Returns a value in a score system compliant with the CSS Specificity rules.The score works as follows:
- Id match adds 0x40000000 to the score.
- Each class and voice match adds 4 to the score.
- Tag matching adds 2 to the score.
- Universal selector matching scores 1.
See also CSS Cascading.
- Parameters:
id- The id of the cue if present,nullotherwise.tag- Name of the tag,nullif it refers to the entire cue.classes- An array containing the classes the tag belongs to. Must not be null.voice- Annotated voice if present,nullotherwise.- Returns:
- The score of the match, zero if there is no match.
-
getStyle
public @com.google.android.exoplayer2.text.webvtt.WebvttCssStyle.StyleFlags int getStyle()
Deprecated.Returns the style orUNSPECIFIEDwhen no style information is given.- Returns:
UNSPECIFIED,STYLE_NORMAL,STYLE_BOLD,STYLE_BOLDorSTYLE_BOLD_ITALIC.
-
isLinethrough
public boolean isLinethrough()
Deprecated.
-
setLinethrough
@CanIgnoreReturnValue public WebvttCssStyle setLinethrough(boolean linethrough)
Deprecated.
-
isUnderline
public boolean isUnderline()
Deprecated.
-
setUnderline
@CanIgnoreReturnValue public WebvttCssStyle setUnderline(boolean underline)
Deprecated.
-
setBold
@CanIgnoreReturnValue public WebvttCssStyle setBold(boolean bold)
Deprecated.
-
setItalic
@CanIgnoreReturnValue public WebvttCssStyle setItalic(boolean italic)
Deprecated.
-
getFontFamily
@Nullable public String getFontFamily()
Deprecated.
-
setFontFamily
@CanIgnoreReturnValue public WebvttCssStyle setFontFamily(@Nullable String fontFamily)
Deprecated.
-
getFontColor
public int getFontColor()
Deprecated.
-
setFontColor
@CanIgnoreReturnValue public WebvttCssStyle setFontColor(int color)
Deprecated.
-
hasFontColor
public boolean hasFontColor()
Deprecated.
-
getBackgroundColor
public int getBackgroundColor()
Deprecated.
-
setBackgroundColor
@CanIgnoreReturnValue public WebvttCssStyle setBackgroundColor(int backgroundColor)
Deprecated.
-
hasBackgroundColor
public boolean hasBackgroundColor()
Deprecated.
-
setFontSize
@CanIgnoreReturnValue public WebvttCssStyle setFontSize(float fontSize)
Deprecated.
-
setFontSizeUnit
@CanIgnoreReturnValue public WebvttCssStyle setFontSizeUnit(@com.google.android.exoplayer2.text.webvtt.WebvttCssStyle.FontSizeUnit int unit)
Deprecated.
-
getFontSizeUnit
public @com.google.android.exoplayer2.text.webvtt.WebvttCssStyle.FontSizeUnit int getFontSizeUnit()
Deprecated.
-
getFontSize
public float getFontSize()
Deprecated.
-
setRubyPosition
@CanIgnoreReturnValue public WebvttCssStyle setRubyPosition(@com.google.android.exoplayer2.text.span.TextAnnotation.Position int rubyPosition)
Deprecated.
-
getRubyPosition
public @com.google.android.exoplayer2.text.span.TextAnnotation.Position int getRubyPosition()
Deprecated.
-
setCombineUpright
@CanIgnoreReturnValue public WebvttCssStyle setCombineUpright(boolean enabled)
Deprecated.
-
getCombineUpright
public boolean getCombineUpright()
Deprecated.
-
-