Methods

(static) applyFont(fontAvailable) → {void}

Applies the downloaded fallback font, or a system font when it is not on disk.

The answer comes from the fetch task (fontAvailable), not from a setting and not from a filesystem probe here: CreateObject("roFileSystem") returns Invalid on the render thread, where this component lives (measured 2026-09-22: it faulted &hec here while the identical code was fine in the Task this component was split out of).

Asking the SETTING instead would be wrong in the case that matters: playbackSubsCustom being on is what TRIGGERS the download, not proof that it succeeded. A server that cannot supply the font leaves the setting on and the file absent, which is exactly when non-Latin subtitles need the fallback most.

Parameters:
NameTypeDescription
fontAvailableboolean
Returns:
Type: 
void

(static) arraysEqual(arr1, arr2) → {boolean}

Parameters:
NameTypeDescription
arr1dynamic
arr2dynamic
Returns:
Type: 
boolean

(static) clearCaptions() → {void}

Stops the timer and drops whatever is on screen. Safe to call before init has built the caption state (a url write can land first).

Returns:
Type: 
void

(static) init() → {void}

Returns:
Type: 
void

(static) newLayoutGroup(labels) → {dynamic}

Parameters:
NameTypeDescription
labelsdynamic
Returns:
Type: 
dynamic

(static) newRect(lg) → {dynamic}

Parameters:
NameTypeDescription
lgdynamic
Returns:
Type: 
dynamic

(static) newlabel(txt) → {dynamic}

Parameters:
NameTypeDescription
txtdynamic
Returns:
Type: 
dynamic

(static) onCaptionDataReceived(event) → {void}

Receives parsed VTT data from the fetch task and manages the caption timer.

Parameters:
NameTypeDescription
eventobject
Returns:
Type: 
void

(static) onDestroy() → {void}

onDestroy: full teardown releasing all resources before component removal. Called by VideoPlayerView.onDestroy() when popping the player scene.

⚠️ This is reachable only because CaptionRenderer.xml declares <function name="onDestroy" />. Without that line callFunc() is a silent no-op and the 100 ms timer below keeps firing for the life of the app.

Returns:
Type: 
void

(static) onUrlChange() → {void}

A new subtitle track, or "" to clear captions entirely.

Captions are cleared HERE rather than at the top of the fetch, so the old track's lines are gone the moment the track changes instead of one thread crossing later.

Returns:
Type: 
void

(static) updateCaption() → {void}

Returns:
Type: 
void