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 interface
WebvttCssStyle.FontSizeUnit
Deprecated.Font size unit enum.static interface
WebvttCssStyle.StyleFlags
Deprecated.Style flag enum.
-
Field Summary
Fields Modifier and Type Field Description static int
FONT_SIZE_UNIT_EM
Deprecated.static int
FONT_SIZE_UNIT_PERCENT
Deprecated.static int
FONT_SIZE_UNIT_PIXEL
Deprecated.static int
STYLE_BOLD
Deprecated.static int
STYLE_BOLD_ITALIC
Deprecated.static int
STYLE_ITALIC
Deprecated.static int
STYLE_NORMAL
Deprecated.static int
UNSPECIFIED
Deprecated.
-
Constructor Summary
Constructors Constructor Description WebvttCssStyle()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
getBackgroundColor()
Deprecated.boolean
getCombineUpright()
Deprecated.int
getFontColor()
Deprecated.String
getFontFamily()
Deprecated.float
getFontSize()
Deprecated.@com.google.android.exoplayer2.text.webvtt.WebvttCssStyle.FontSizeUnit int
getFontSizeUnit()
Deprecated.@com.google.android.exoplayer2.text.span.TextAnnotation.Position int
getRubyPosition()
Deprecated.int
getSpecificityScore(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 int
getStyle()
Deprecated.Returns the style orUNSPECIFIED
when no style information is given.boolean
hasBackgroundColor()
Deprecated.boolean
hasFontColor()
Deprecated.boolean
isLinethrough()
Deprecated.boolean
isUnderline()
Deprecated.WebvttCssStyle
setBackgroundColor(int backgroundColor)
Deprecated.WebvttCssStyle
setBold(boolean bold)
Deprecated.WebvttCssStyle
setCombineUpright(boolean enabled)
Deprecated.WebvttCssStyle
setFontColor(int color)
Deprecated.WebvttCssStyle
setFontFamily(String fontFamily)
Deprecated.WebvttCssStyle
setFontSize(float fontSize)
Deprecated.WebvttCssStyle
setFontSizeUnit(@com.google.android.exoplayer2.text.webvtt.WebvttCssStyle.FontSizeUnit int unit)
Deprecated.WebvttCssStyle
setItalic(boolean italic)
Deprecated.WebvttCssStyle
setLinethrough(boolean linethrough)
Deprecated.WebvttCssStyle
setRubyPosition(@com.google.android.exoplayer2.text.span.TextAnnotation.Position int rubyPosition)
Deprecated.void
setTargetClasses(String[] targetClasses)
Deprecated.void
setTargetId(String targetId)
Deprecated.void
setTargetTagName(String targetTag)
Deprecated.void
setTargetVoice(String targetVoice)
Deprecated.WebvttCssStyle
setUnderline(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,null
otherwise.tag
- Name of the tag,null
if 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,null
otherwise.- 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 orUNSPECIFIED
when no style information is given.- Returns:
UNSPECIFIED
,STYLE_NORMAL
,STYLE_BOLD
,STYLE_BOLD
orSTYLE_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.
-
-