Methods

(static) availSubtitleTrackIdx(video, sub_idx) → {integer}

Roku translates the info provided in subtitleTracks into availableSubtitleTracks Including ignoring tracks, if they are not understood, thus making indexing unpredictable. This function translates between our internel selected subtitle index and the corresponding index in availableSubtitleTracks.

Parameters:
NameTypeDescription
videodynamic
sub_idxdynamic
Returns:
Type: 
integer

(static) changeSubtitleDuringPlayback(newid) → {void}

Parameters:
NameTypeDescription
newiddynamic
Returns:
Type: 
void

(static) defaultSubtitleTrack(sorted_subtitles, require_textopt) → {integer}

Identify the default subtitle track if "requires_text" is true, only return a track if it is textual This allows forcing text subs, since roku requires transcoding of non-text subs returns the server-side track index for the appriate subtitle

Parameters:
NameTypeAttributesDefaultDescription
sorted_subtitlesdynamic
require_textdynamic<optional>
false
Returns:
Type: 
integer

(static) defaultSubtitleTrackFromVid(video_id) → {integer}

Identify the default subtitle track for a given video id returns the server-side track index for the appriate subtitle

Parameters:
NameTypeDescription
video_iddynamic
Returns:
Type: 
integer

(static) getSubtitleLanguages() → {dynamic}

Returns:
Type: 
dynamic

(static) getSubtitleSelIdxFromSubIdx(subtitles, sub_idx) → {integer}

The subtitle index on the server differs from the index we track locally This function converts the former into the latter

Parameters:
NameTypeDescription
subtitlesdynamic
sub_idxdynamic
Returns:
Type: 
integer

(static) selectSubtitleTrack(tracks, currentopt) → {integer}

Parameters:
NameTypeAttributesDefaultDescription
tracksdynamic
currentdynamic<optional>
-1
Returns:
Type: 
integer

(static) selectSubtitleTrackDialog(tracks, currentTrackopt) → {dynamic}

Present Dialog to user to select subtitle track

Parameters:
NameTypeAttributesDefaultDescription
tracksdynamic
currentTrackdynamic<optional>
-1
Returns:
Type: 
dynamic

(static) setupSubtitle(video, subtitles, subtitle_idxopt) → {integer}

Given a set of subtitles, and a subtitle index (the index on the server, not in the list provided) this will set all relevant settings for roku (mainly closed captions) and return the index of the subtitle track specified, but indexed based on the provided list of subtitles

Parameters:
NameTypeAttributesDefaultDescription
videodynamic
subtitlesdynamic
subtitle_idxdynamic<optional>
-1
Returns:
Type: 
integer

(static) sortSubtitles(id, MediaStreams) → {dynamic}

Checks available subtitle tracks and puts subtitles in forced, default, and non-default/forced but preferred language at the top

Parameters:
NameTypeDescription
idstring
MediaStreamsdynamic
Returns:
Type: 
dynamic

(static) turnoffSubtitles() → {void}

Returns:
Type: 
void