Members

(static, constant) TRICKPLAYBAR_POSITION_LABEL_INDEX

Child index for position label in Roku's built-in trickPlayBar component. The trickPlayBar is part of the Video node and doesn't expose child IDs, so we must access by index. Fallback search logic exists if Roku changes the structure. Defined at module level (BrighterScript const requirement) to provide immutability and enable reuse across multiple helper functions if needed.

Default Value
  • 8

Methods

(static) announceNowPlaying() → {object}

Returns the metadata in the response — main.bs's transport dispatcher calls roAppManager.SetNowPlayingContentMetaData() on the MAIN thread (roAppManager can't be created on the render thread, where this callFunc executes).

Returns:
Type: 
object

(static) availSubtitleTrackIdx(tracknameToFind) → {integer}

availSubtitleTrackIdx: Returns Roku's index for requested subtitle track

Parameters:
NameTypeDescription
tracknameToFindstring

TrackName for subtitle we're looking to match

Returns:

indicating Roku's index for requested subtitle track. Returns SubtitleSelection.NONE if not found

Type: 
integer

(static) bufferCheck() → {void}

Check the the buffering has not hung

Returns:
Type: 
void

(static) checkMediaSegments() → {void}

Check media segments and trigger appropriate actions based on current playback position

Returns:
Type: 
void

(static) checkTimeToDisplayNextEpisode() → {void}

Checks if we need to display the Next Episode button

Returns:
Type: 
void

(static) findTrickPlayBarPositionLabel() → {dynamic}

findTrickPlayBarPositionLabel: Defensively finds the position text label in trickPlayBar

Tries multiple strategies to find the Label that displays seek position:

  1. Expected child index (8) - fast path for current Roku OS
  2. Search for FIRST Label child - position text comes before remaining time
  3. Return invalid if not found - feature gracefully degrades
Returns:
  • Label node or invalid if not found
Type: 
dynamic

(static) forceFinishPlayback() → {void}

Forces playback to finished state for proper watched-status and auto-play. Triggers synchronous teardown (onState -> ViewCreator -> popScene -> onDestroy), invalidating all m. references. Callers MUST return immediately after calling.

Returns:
Type: 
void

(static) getCurrentChapterIndex() → {integer}

getCurrentChapterIndex: Finds current chapter index

Returns:

indicating index of current chapter within chapter data or 0 if chapter lookup fails

Type: 
integer

(static) getInstantReplaySeconds() → {integer}

Returns:
Type: 
integer

(static) handleChapterListAction() → {void}

handleChapterListAction: Handles action to show chapter list

Returns:
Type: 
void

(static) handleChapterSkipAction(action) → {void}

handleChapterSkipAction: Handles user command to skip chapters in playing video

Parameters:
NameTypeDescription
actionstring
Returns:
Type: 
void

(static) handleGoToLiveAction() → {void}

Returns:
Type: 
void

(static) handleHideAction(resume) → {void}

handleHideAction: Handles action to hide OSD menu

Parameters:
NameTypeDescription
resumeboolean

controls whether or not to resume video playback when sub is called

Returns:
Type: 
void

(static) handleItemSkipAction(action) → {void}

handleItemSkipAction: Handles user command to skip items

Parameters:
NameTypeDescription
actionstring

skip action to take

Returns:
Type: 
void

(static) handleShowAudioMenuAction() → {void}

handleShowAudioMenuAction: Handles action to show audio selection menu

Returns:
Type: 
void

(static) handleShowSubtitleMenuAction() → {void}

handleShowSubtitleMenuAction: Handles action to show subtitle selection menu

Returns:
Type: 
void

(static) handleShowVideoInfoPopupAction() → {void}

handleShowVideoInfoPopupAction: Handles action to show video info popup

Returns:
Type: 
void

(static) handleShowVideoSourceMenuAction() → {void}

handleShowVideoSourceMenuAction: Handles action to show video source selection menu

Returns:
Type: 
void

(static) handleTransport(evt) → {object}

handleTransport: Roku voice transport handler. Called from source/main.bs when an roInputEvent with info.type = "transport" arrives and the active scene is this player.

Returns { status: "" } per roInput.EventResponse() — Roku OS uses the status to render the appropriate HUD message. Codes used here:

  • success / success.seek-start / success.seek-end — op completed (with bounds note)
  • error.redundant — state already matches request (e.g. pause-while-paused)
  • error.generic — op semantically unsupported in this context
  • unhandled — command we don't recognize; lets Roku show "Command not available"

See https://github.com/rokudev/dev-doc — docs/DEVELOPER/media-playback/voice-controls/transport-controls.md

Parameters:
NameTypeDescription
evtobject
Returns:
Type: 
object

(static) handleVideoPlayPauseAction() → {void}

handleVideoPlayPauseAction: Handles action to either play or pause the video content

Returns:
Type: 
void

(static) handleVoiceNextItem() → {object}

Reuse the OSD itemNext code path so Live-TV channel advance, queue advance, and Episode→next-Episode all behave identically to pressing the on-screen Next button.

Returns:
Type: 
object

(static) handleVoiceSeekCommand(evt) → {object}

Parameters:
NameTypeDescription
evtobject
Returns:
Type: 
object

(static) hideNextEpisodeButton() → {void}

Hide the Next Episode notification

Returns:
Type: 
void

(static) init() → {void}

Returns:
Type: 
void

(static) isLiveTvPlayback() → {boolean}

Returns:
Type: 
boolean

(static) isNotificationVisible(notification) → {boolean}

Check if a VideoNotification is visually present (including during fade-out animation)

Parameters:
NameTypeDescription
notificationobject
Returns:
Type: 
boolean

(static) loadCaption() → {void}

Set caption url to server subtitle track and run the fetch task

Returns:
Type: 
void

(static) loadChannelListForQueue() → {void}

Returns:
Type: 
void

(static) onAllowCaptionsChange() → {void}

Only setup caption items if captions are allowed

Returns:
Type: 
void

(static) onAudioIndexChange() → {void}

Event handler for when audioIndex changes. For direct play: switches audio track directly using Roku's availableAudioTracks (no stop/reload needed since all tracks are in the container). For transcoded — or when the newly-selected stream exceeds the device's audio capability (e.g. switching from stereo back to an 8ch track on a stereo Roku) — must reload so the server transcodes the new selection.

Returns:
Type: 
void

(static) onChannelListLoaded() → {void}

Returns:
Type: 
void

(static) onContentChange() → {void}

Event handler for when video content field changes

Returns:
Type: 
void

(static) onDestroy() → {void}

onDestroy: Full teardown releasing all resources before component removal Called by SceneManager when popping this scene

Returns:
Type: 
void

(static) onKeyEvent(key, press) → {boolean}

Parameters:
NameTypeDescription
keystring
pressboolean
Returns:
Type: 
boolean

(static) onLiveTvMetadataRefreshed() → {void}

Returns:
Type: 
void

(static) onNextEpisodeDataLoaded() → {void}

Returns:
Type: 
void

(static) onNextEpisodeNotificationAction() → {void}

Handler for Next Episode notification action

Returns:
Type: 
void

(static) onNotificationStateChanged() → {void}

Safety net: ensure focus isn't orphaned after notification dismissal animation completes

Returns:
Type: 
void

(static) onOSDAction() → {void}

onOSDAction: Process action events from OSD to their respective handlers

Returns:
Type: 
void

(static) onPlaybackErrorButtonSelected(msg) → {void}

Parameters:
NameTypeDescription
msgdynamic
Returns:
Type: 
void

(static) onPlaybackErrorDialogClosed(msg) → {void}

Parameters:
NameTypeDescription
msgdynamic
Returns:
Type: 
void

(static) onPositionChanged() → {void}

When Video Player state changes

Returns:
Type: 
void

(static) onSegmentNotificationAction() → {void}

Handler for segment notification action

Returns:
Type: 
void

(static) onState() → {void}

When Video Player state changes

Returns:
Type: 
void

(static) onSubtitleChange() → {void}

Event handler for when selectedSubtitle changes

Returns:
Type: 
void

(static) onTrickPlayBarTextChange() → {void}

Called when Roku's trickPlayBar position text changes Parses the time string to get seek position and syncs our carousel This ensures carousel stays in sync with Roku's authoritative seek position

Returns:
Type: 
void

(static) onVideoContentLoaded() → {void}

Returns:
Type: 
void

(static) onVideoSourceChange() → {void}

onVideoSourceChange: Handles video source switching from OSD Saves position, stops playback, re-selects audio for the new source's streams, and reloads video content with the new MediaSource ID.

Returns:
Type: 
void

(static) populateChapterMenu() → {void}

populateChapterMenu: ' Parse chapter data from API and appeand to chapter list menu

Returns:
Type: 
void

(static) reportPlayback(stateopt) → {void}

Report playback to server

Parameters:
NameTypeAttributesDefaultDescription
statestring<optional>
"update"
Returns:
Type: 
void

(static) retryPlayback(bypassDovi, forceTranscode) → {void}

retryPlayback: Re-runs the content loader from the current position with updated task flags. Used by error handlers to retry without exiting the player.

Parameters:
NameTypeDescription
bypassDoviboolean

skips DoVi container profile so the server can grant direct play

forceTranscodeboolean

disables direct play so the server returns a transcode URL

Returns:
Type: 
void

(static) seekRelativeWithBounds(deltaSeconds) → {object}

Parameters:
NameTypeDescription
deltaSecondsinteger
Returns:
Type: 
object

(static) seekToWithBounds(targetSeconds) → {object}

30s end-slack matches the Roku transport-controls reference example for video — clamping shy of duration prevents the player from firing end-of-content immediately.

Parameters:
NameTypeDescription
targetSecondsfloat
Returns:
Type: 
object

(static) setFavorite(isLike) → {object}

Parameters:
NameTypeDescription
isLikeboolean
Returns:
Type: 
object

(static) shouldUseCustomSubtitlesForCurrentSelection() → {boolean}

Determines if custom subtitles should be used for the current selection Custom subtitles should only be used for external subtitles when the user has enabled the setting

Returns:
Type: 
boolean

(static) showChannelSwitchSpinner(nextItem) → {void}

Parameters:
NameTypeDescription
nextItemobject
Returns:
Type: 
void

(static) showNextEpisodeButton() → {void}

Show the Next Episode notification with countdown text

Returns:
Type: 
void

(static) showPlaybackErrorDialog(errorMessageopt) → {void}

Parameters:
NameTypeAttributesDefaultDescription
errorMessagestring<optional>
""
Returns:
Type: 
void

(static) stateAllowsOSD() → {boolean}

stateAllowsOSD: Check if current video state allows showing the OSD

Returns:

indicating if video state allows the OSD to show

Type: 
boolean

(static) switchToQueueItem(queueManager, targetPosition) → {void}

m.isSwitchingChannel prevents the old view's onState("stopped") from hiding the spinner before the new VideoPlayerView finishes loading.

Parameters:
NameTypeDescription
queueManagerobject
targetPositioninteger
Returns:
Type: 
void

(static) toggleCaption() → {void}

Toggles visibility of custom subtitles and sets captionTask's player state

Returns:
Type: 
void

(static) triggerLiveTvMetadataRefresh() → {void}

Returns:
Type: 
void

(static) tryActiveSegmentSkip() → {boolean}

Skip an active media segment (intro/recap/etc.) if one is currently in-window. Returns true if a segment was skipped, false if no active segment.

Returns:
Type: 
boolean

(static) updateCaption() → {void}

Removes old subtitle lines and adds new subtitle lines

Returns:
Type: 
void

(static) updateNextEpisodeCount() → {void}

Update Next Episode countdown text

Returns:
Type: 
void

(static) updateTrickplayCarousel(position) → {void}

Updates trickplay carousel with index calculated from video position Snaps to thumbnail boundaries for cleaner UX

Parameters:
NameTypeDescription
positionFloat

Video position in seconds

Returns:
Type: 
void