KONtx.cc

closed captions singleton

The KONtx.cc singleton provides app developers with a JavaScript API to implement closed captioning for streaming video content. The entire Closed Captioning JavaScript API is contained in the common namespace KONtx.cc.

Example

Properties

Property

Type

Description

config.activatedStorageKey

String

The key for enabling and disabling closed captioning.

config.assetPath

String

The path to the closed captions assets including module images.

config.debug_timeSignatureOffset

integer

Pseudo-property that provides a method for app developers to test captions at any start time. The specified number of seconds are shaved off from the begin and end times. To test entries that start at 20 minutes use (60 * 20). The common.debug.level must be greater than or equal to two (2).

config.debug_ttmlLocation

String

Pseudo-property that provides a method for app developers to load a test TTML URI and ignore the TTML URI attached to the video stream. The common.debug.level must be greater than or equal to two (2).

config.defaultLanguage

String

The default captions language is "en".

config.include

Array[String]

Array of strings to be auto-included during the load of the actuator file. This feature is not available in current KONtx Frameworks.

config.languageStorageKey

String

The key for setting and getting the closed captions language.

config.links

Array[Object]

Array of Objects to set up "lazy links" during the load of the actuator file. This feature is not available in current KONtx Frameworks.

config.modulePath

String

The path to the closed captioning implementation. Used to determine if the module is loaded locally from the app or globally from the framework.

config.yqlHost

String

The default entry point for the YQL REST API. The default value is http://ctv.yql.yahooapis.com/v1/public/yql.

config.yqlQuery

String

The default normalization query sent to YQL. The default value is "select * from ctv.ttml.normalize where url='%1'".

enabled

Boolean

Pseudo-property for the closed captioning button activation state stored in the viewer's profile.

engineInterface

Boolean/String

Read-only pseudo-property set to false if the TV API Engine closed captioning interface is not set and hardware rendering is not available. Set to the TV API closed captioning interface (tv.cc) if hardware rendering is available.

log

Object

The common debug log.

name

String

String name "CC" for the closed captioning singleton.

playerActive

Boolean

Read-only pseudo-property returns true if KONtx.mediaplayer.tvapi.currentPlayerState is PLAY, PAUSE, FORWARD, REWIND, or BUFFERING. The value is false otherwise.

playerState

integer

Read-only pseudo-property for the KONtx.mediaplayer.tvapi.currentPlayerState media player current state enumeration constant.

playerStates

Object

The KONtx.mediaplayer.constants.states media player states enumeration constants.

renderer

String

Pseudo-property string value for hardware or software-based rendering that is initialized to "auto" to use the device's hardware renderer if available. The value is set to "software" to use Yahoo's software-based renderer if hardware support is not available. The Simulator uses Yahoo's software renderer.

state.engineInterface

Boolean/String

Boolean value set to false if the TV API Engine closed captioning interface is not set and hardware support is not available. Set to the TV API closed captioning interface (tv.cc) if hardware support is available.

state.useHardware

Boolean

Boolean value set to true if hardware support is available. The value is false otherwise.

toString

function

Overrides the default, using the common toString() function to return the class name.

useHardware

Boolean

Boolean value set to true if the hardware device supports closed captioning and the KONtx.cc.renderer property is set to "auto". The value is false otherwise.

version

String

Version of the closed captioning module.

Methods

bool fetch(Object config);

Fetches the JSON formated XML via YQL using the given config.url.

String getLanguage();

Returns the closed captioning language stored in the viewer's profile.

Object playerStatesLegend();

Returns the media player states enumeration constansts as an Object.

void setLanguage(String lang);

Sets the closed captioning language in the viewer's profile to the given string lang.

Table of Contents