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.
| Name | Type | Description |
|---|---|---|
video | dynamic | |
sub_idx | dynamic |
- Source
- Type:
- integer
(static) defaultSubtitleTrack(sortedSubtitles, selectedAudioLanguage, requireTextopt) → {integer}
defaultSubtitleTrack:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
sortedSubtitles | dynamic | array of subtitles sorted by type and language | ||
selectedAudioLanguage | string | language for selected audio track | ||
requireText | boolean | <optional> | false | indicates if only text subtitles should be considered |
- Source
indicating the default track's server-side index. Defaults to {SubtitleSelection.none} if one is not found
- Type:
- integer
(static) defaultSubtitleTrackFromVid(meta, selectedAudioIndex) → {integer}
defaultSubtitleTrackFromVid: Identifies the default subtitle track given metadata and audio index
| Name | Type | Description |
|---|---|---|
meta | object | metadata object containing MediaSources with MediaStreams |
selectedAudioIndex | integer | index of selected audio stream (used for Smart mode language matching) |
- Source
subtitle track index or SubtitleSelection.none if not found
- Type:
- integer
(static) getSubtitleLanguages() → {dynamic}
- Source
- 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
| Name | Type | Description |
|---|---|---|
subtitles | dynamic | |
sub_idx | dynamic |
- Source
- Type:
- integer
(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
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
video | dynamic | |||
subtitles | dynamic | |||
subtitle_idx | dynamic | <optional> | SubtitleSelection.none |
- Source
- Type:
- integer
(static) sortSubtitles(MediaStreams) → {dynamic}
Checks available subtitle tracks and puts subtitles in forced, default, and non-default/forced but preferred language at the top
| Name | Type | Description |
|---|---|---|
MediaStreams | dynamic |
- Source
- Type:
- dynamic