Interface TextTrackStyle

The text track style API.

Remarks


- Available since v2.27.4.

interface TextTrackStyle {
    backgroundColor: undefined | string;
    edgeStyle: undefined | EdgeStyle;
    fontColor: undefined | string;
    fontFamily: undefined | string;
    fontSize: undefined | string;
    marginBottom: undefined | number;
    marginLeft: undefined | number;
    marginRight: undefined | number;
    marginTop: undefined | number;
    windowColor: undefined | string;
    addEventListener<TType>(type, listener): void;
    removeEventListener<TType>(type, listener): void;
}

Hierarchy (view full)

Properties

backgroundColor: undefined | string

The background color for the text track.

Remarks

This targets the area directly behind the text.

Example

<br/> - `red` will set the background color of the text track to red.
<br/> - `#ff0000` will set the background color of the text track to red.
<br/> - `rgba(255,0,0,0.5)` will set the background color of the text track to red, with 50% opacity.
edgeStyle: undefined | EdgeStyle

The edge style of the text, represented by a value from the following list:
- 'none'
- 'dropshadow'
- 'raised'
- 'depressed'
- 'uniform

fontColor: undefined | string

The font color for the text track.

Example

<br/> - `red` will set the color of the text to red.
<br/> - `#ff0000` will set the color of the text to red.
<br/> - `rgba(255,0,0,0.5)` will set the color of the text to red, with 50% opacity.
fontFamily: undefined | string

The font family for the text track.

fontSize: undefined | string

The font size for the text track.

Remarks

Can be a percentage value such as '50%', '75%', '100%', '150%' or '200%'.

marginBottom: undefined | number

The bottom margin of the area where subtitles are being rendered.

Remarks


- Available since v4.2.0
- The margin is in number of pixels.
- Useful for pushing the subtitles up, so they don't overlap with the UI.

marginLeft: undefined | number

The left margin of the area where subtitles are being rendered.

Remarks


- Available since v4.2.0
- The margin is in number of pixels.
- Useful for pushing the subtitles right, so they don't overlap with the UI.

marginRight: undefined | number

The right margin of the area where subtitles are being rendered.

Remarks


- Available since v4.2.0
- The margin is in number of pixels.
- Useful for pushing the subtitles left, so they don't overlap with the UI.

marginTop: undefined | number

The top margin of the area where subtitles are being rendered.

Remarks


- Available since v4.2.0
- The margin is in number of pixels.
- Useful for pushing the subtitles down, so they don't overlap with the UI.

windowColor: undefined | string

The window color for the text track.

Remarks

This targets the area covering the full width of the text track.

Example

<br/> - `red` will set the background color of the window of the text track to red.
<br/> - `#ff0000` will set the background color of the window of the text track to red.
<br/> - `rgba(255,0,0,0.5)` will set the background color of the window of the text track to red, with 50% opacity.

Methods

Generated using TypeDoc