Class

media/Subtitle

media/Subtitle()

Constructor

# new media/Subtitle()

Reimplementation of Subtitle Track Extension.

This is to support operation on both internal and external subtitle track via strategies for XDK Player.

Implements:

Methods

# async getCurrentSubtitle() → {Promise.<Subtitle>}

Retrieve information about the current subtitle.

Native Promise.

Promise.<Subtitle>

# getSubtitles() → {Promise.<Array.<Subtitle>>}

Retrieve all subtitles information. The subtitle information will be cached locally and made available via the function getCurrentSubtitle.

Native Promise.

Promise.<Array.<Subtitle>>

# async hideSubtitle() → {Promise.<true>}

Hide the current subtitle.

Native Promise.

Promise.<true>

# async prepare(player, optionsopt) → {Promise.<void>}

Import the player specific subtitle strategy/strategies, and prepare it/them.

Parameters:
Name Type Attributes Description
player Plater

XDK Player instance.

options Object <optional>

Optional player option, with or without the subtitle specific details.

Implements:

Native Promise.

Promise.<void>

# async showSubtitle(index) → {Promise.<true>}

Show the subtitle specified by the index.

Parameters:
Name Type Description
index Number

Index of the targetted subtitle, compare to all subtitle information returned.

Native Promise.

Promise.<true>

media/Subtitle(confignullable)

Constructor

# new media/Subtitle(confignullable)

Initialise the Subtitle extension management.

Parameters:
Name Type Attributes Description
config Array.<ExtensionConfig> <nullable>

An array of valid Subtitle extension configs are expected.

Methods

# async getCurrentSubtitle() → {Promise.<Subtitle>}

Retrieve information about the current subtitle.

Native Promise.

Promise.<Subtitle>

# getSubtitles() → {Promise.<Array.<Subtitle>>}

Retrieve all subtitles information. The subtitle information will be cached locally and made available via the function getCurrentSubtitle.

Native Promise.

Promise.<Array.<Subtitle>>

# async hideSubtitle() → {Promise.<true>}

Hide the current subtitle.

Native Promise.

Promise.<true>

# async prepare(player, optionsopt) → {Promise.<void>}

Import the player specific subtitle strategy/strategies, and prepare it/them.

Parameters:
Name Type Attributes Description
player Plater

XDK Player instance.

options Object <optional>

Optional player option, with or without the subtitle specific details.

Implements:

Native Promise.

Promise.<void>

# async showSubtitle(index) → {Promise.<true>}

Show the subtitle specified by the index.

Parameters:
Name Type Description
index Number

Index of the targetted subtitle, compare to all subtitle information returned.

Native Promise.

Promise.<true>