Methods
(static) availableSubtitleTrackIndex(availableSubtitleTracks, trackNameToFind) → {integer}
Roku translates the tracks we supply into availableSubtitleTracks, dropping any it does not understand — so its indexing does not match Jellyfin's. This maps a Jellyfin track name onto Roku's list.
Substring rather than equality: Roku mangles the name it was given (our value survives inside it), so an exact compare never matches.
| Name | Type | Description |
|---|---|---|
availableSubtitleTracks | object | |
trackNameToFind | string |
- index into availableSubtitleTracks, or SubtitleSelection.NONE
- Type:
- integer
(static) buildAudioTrackOptions(audioStreams, currentAudioIndex) → {object}
Audio tracks. values are Jellyfin stream indexes, which is what VideoPlayerView.audioIndex takes.
| Name | Type | Description |
|---|---|---|
audioStreams | object | VideoPlayerView.fullAudioData (array of audio MediaStreams) |
currentAudioIndex | integer | the stream index playing now (VideoPlayerView.audioIndex) |
- { labels, values, defaultIndex }
- Type:
- object
(static) buildSubtitleTrackOptions(subtitleStreams, selectedSubtitleIndex, currentTrackName, availableSubtitleTracks) → {object}
Subtitle tracks, with a "None" option always first.
Each value is { index, isEncoded, trackName }: index - Jellyfin stream index, or SubtitleSelection.NONE for the None row isEncoded - burned into the video by the transcoder, so Roku cannot toggle it trackName - the Jellyfin track name, matched against Roku's own mangled availableSubtitleTracks names (see availableSubtitleTrackIndex)
Which row is active depends on where the current subtitle came from: an in-file track is identified by its Jellyfin index, while an external one is only identifiable by matching the Roku track name currently set on the player.
| Name | Type | Description |
|---|---|---|
subtitleStreams | object | VideoPlayerView.fullSubtitleData |
selectedSubtitleIndex | integer | VideoPlayerView.selectedSubtitle |
currentTrackName | string | VideoPlayerView.subtitleTrack (Roku's name for the active track) |
availableSubtitleTracks | object | VideoPlayerView.availableSubtitleTracks |
- { labels, values, defaultIndex }
- Type:
- object
(static) buildVideoSourceOptions(videoSources, currentMediaSourceId) → {object}
Video sources (alternate versions of the same item). values are MediaSource ids, which is what VideoPlayerView.mediaSourceId takes.
| Name | Type | Description |
|---|---|---|
videoSources | object | VideoPlayerView.fullVideoSourceData (array of MediaSources) |
currentMediaSourceId | string | the source playing now |
- { labels, values, defaultIndex }
- Type:
- object
(static) isSubtitleStreamActive(stream, selectedSubtitleIndex, currentTrackName, availableSubtitleTracks) → {boolean}
Is this the subtitle stream currently showing? Split out because the two cases answer completely different questions (see buildSubtitleTrackOptions).
| Name | Type | Description |
|---|---|---|
stream | object | |
selectedSubtitleIndex | integer | |
currentTrackName | string | |
availableSubtitleTracks | object |
- Type:
- boolean