Closed Captioning ActionScript APIs (Player V2 Deprecated)

Closed Captioning ActionScript APIs enable you to get supported closed captions, set closed caption languages, and get the caption timing.

Closed Captioning Properties

Note: This software is deprecated. Use the latest version.

The following table describes all the ActionScript properties that are associated with close captioning.

Function Description
getCurrentItemClosedCaptionsLanguages

Get a list of supported closed captions languages for the currently playing item. This list is derived from the closed captions XML file for this content, uploaded via Backlot. If there is no such file, this will return an empty list.

Type: List

Return Values: language code : displayName. | empty list.

Example: { en: English, ... }

Exception: This method throws an exception if no Closed Captions file has been uploaded for the current embed code.

getTimedText(startTime, endTime)

Returns the timed text (captions) which appear between the startTime and endTime. The returned timed text contains the captions and caption formatting information.

Type: String

Parameters: startTime and endTime in seconds.

Return Values: captions and caption formatting text.

Example: 200, 230, returns any captions occurring in the 30 seconds between the 200 and 230 second interval of an asset.

setClosedCaptionsLanguage

Sets the language of the closed captions which will be shown in the player.

Type: String

Parameter: language

Parameter Values: language code | none. Accepts any ISO 639-1 language code. Use zh-hans for Simplified Chinese and zh-hant for Traditional Chinese.

To show no closed captions, set the language to none.

Example: en, de, ja

Exception: This method throws an exception if no Closed Captions file has been uploaded for the current embed code.

Related Information

The following list provides links to Backlot documentation that provides some general information about closed captions and closed caption languages.

Was this article helpful?