Back to Exoplayer

WebvttCssStyle (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/text/webvtt/WebvttCssStyle.html

latest12.8 KB
Original Source

Package com.google.android.exoplayer2.text.webvtt

Class WebvttCssStyle


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classWebvttCssStyleextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

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 or UNSPECIFIED 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. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

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

Constructor Detail

- 

WebvttCssStyle

public WebvttCssStyle()

Deprecated.

Method Detail

- 

setTargetId

public void setTargetId​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")targetId)

Deprecated.

- 

setTargetTagName

public void setTargetTagName​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")targetTag)

Deprecated.

- 

setTargetClasses

public void setTargetClasses​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")[] targetClasses)

Deprecated.

- 

setTargetVoice

public void setTargetVoice​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")targetVoice)

Deprecated.

- 

getSpecificityScore

public int getSpecificityScore​(@Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")id,
                               @Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")tag,[Set](https://developer.android.com/reference/java/util/Set.html "class or interface in java.util")<[String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang")> classes,
                               @Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")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 or UNSPECIFIED when no style information is given. Returns:UNSPECIFIED, STYLE_NORMAL, STYLE_BOLD, STYLE_BOLD or STYLE_BOLD_ITALIC.

- 

isLinethrough

public boolean isLinethrough()

Deprecated.

- 

setLinethrough

@CanIgnoreReturnValue
public[WebvttCssStyle](WebvttCssStyle.html "class in com.google.android.exoplayer2.text.webvtt")setLinethrough​(boolean linethrough)

Deprecated.

- 

isUnderline

public boolean isUnderline()

Deprecated.

- 

setUnderline

@CanIgnoreReturnValue
public[WebvttCssStyle](WebvttCssStyle.html "class in com.google.android.exoplayer2.text.webvtt")setUnderline​(boolean underline)

Deprecated.

- 

setBold

@CanIgnoreReturnValue
public[WebvttCssStyle](WebvttCssStyle.html "class in com.google.android.exoplayer2.text.webvtt")setBold​(boolean bold)

Deprecated.

- 

setItalic

@CanIgnoreReturnValue
public[WebvttCssStyle](WebvttCssStyle.html "class in com.google.android.exoplayer2.text.webvtt")setItalic​(boolean italic)

Deprecated.

- 

getFontFamily

@Nullable
public[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")getFontFamily()

Deprecated.

- 

setFontFamily

@CanIgnoreReturnValue
public[WebvttCssStyle](WebvttCssStyle.html "class in com.google.android.exoplayer2.text.webvtt")setFontFamily​(@Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")fontFamily)

Deprecated.

- 

getFontColor

public int getFontColor()

Deprecated.

- 

setFontColor

@CanIgnoreReturnValue
public[WebvttCssStyle](WebvttCssStyle.html "class in com.google.android.exoplayer2.text.webvtt")setFontColor​(int color)

Deprecated.

- 

hasFontColor

public boolean hasFontColor()

Deprecated.

- 

getBackgroundColor

public int getBackgroundColor()

Deprecated.

- 

setBackgroundColor

@CanIgnoreReturnValue
public[WebvttCssStyle](WebvttCssStyle.html "class in com.google.android.exoplayer2.text.webvtt")setBackgroundColor​(int backgroundColor)

Deprecated.

- 

hasBackgroundColor

public boolean hasBackgroundColor()

Deprecated.

- 

setFontSize

@CanIgnoreReturnValue
public[WebvttCssStyle](WebvttCssStyle.html "class in com.google.android.exoplayer2.text.webvtt")setFontSize​(float fontSize)

Deprecated.

- 

setFontSizeUnit

@CanIgnoreReturnValue
public[WebvttCssStyle](WebvttCssStyle.html "class in com.google.android.exoplayer2.text.webvtt")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](WebvttCssStyle.html "class in com.google.android.exoplayer2.text.webvtt")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](WebvttCssStyle.html "class in com.google.android.exoplayer2.text.webvtt")setCombineUpright​(boolean enabled)

Deprecated.

- 

getCombineUpright

public boolean getCombineUpright()

Deprecated.