ApplyResponsiveLayout() so MainScene can relayout it when the display resolution changes.
MainScene
MainScene
File:
Extends:
components/MainScene.*Extends:
ScenePurpose
Root scene and app lifecycle orchestrator. Initializes global state, manages the screen stack, drives the handshake → auth → playlist startup sequence, and handles deep links.Interface fields
Key children
Key behaviors
- On
init(): callsGTV_InitGlobalState(), creates relayout and focus-repair timers, creates the session auth timer (SESSION_AUTH_CHECK_MS = 420000 ms), then callsShowSplash(). - After splash: checks registry for saved credentials. If found, runs auto-login; otherwise shows
OnboardingScreen. - Screen stack: only one primary screen is active at a time (
m.currentScreen).MainScreenandPlayerScreenco-exist as siblings;MainScreenis shown in overlay mode when the channel list is requested over the player. - Session auth timer fires every 7 minutes while authenticated and re-runs
AuthTasksilently. On failure it classifies the reason and shows the appropriate session-issue dialog. - Signals
AppDialogInitiate/AppDialogCompleteRoku certification beacons during pre-home dialogs. signalBeacon("AppLaunchComplete")is fired byMainScreenonce the channel grid is visible.
SplashScreen
SplashScreen
File:
Extends:
components/SplashScreen/SplashScreen.*Extends:
GroupPurpose
Launch splash displayed immediately after app start. Shows the GlobalTV logo and splash image, then firessplashDone after SPLASH_MS (1 500 ms).Interface fields
Key children
Key behaviors
- Timer duration maps directly to
AppConstants().SPLASH_MS / 1000(1.5 seconds). ApplyResponsiveLayout()repositions children to match the current safe-area layout context.
OnboardingScreen
OnboardingScreen
File:
Extends:
components/OnboardingScreen/OnboardingScreen.*Extends:
GroupPurpose
First-run / logged-out screen. Presents the app branding and a prompt to proceed to login. Also handles exit requests.Interface fields
Key behaviors
- Signals
AppDialogInitiate("OnboardingScreen")for Roku certification timing. ApplyResponsiveLayout()adapts to 1080p / 720p display modes.
LoginScreen
LoginScreen
File:
Extends:
components/LoginScreen/LoginScreen.*Extends:
GroupPurpose
On-device credential entry screen. Collects username and password, optionally calls Roku’sgetUserData RFI to pre-fill the Roku account email, authenticates via AuthTask, and returns the result to MainScene.Interface fields
Key children
Key behaviors
- Two virtual keyboard fields (username, password) managed on the render thread via standard
roKeyEventhandling. - “Show password” toggle reveals masked password characters.
- Calls Roku
getUserDatato request the subscriber’s Roku email (rokuEmail) as part of the auth context. - Displays inline
statusHintLabelduring auth to relayAuthTask.statusMessageprogress text (e.g. “Conectando con servidor local…”). - Signals
AppDialogInitiate("LoginScreen")for certification beacon tracking.
MainScreen
MainScreen
File:
Extends:
components/MainScreen/MainScreen.*Extends:
GroupPurpose
Channel grid/list. Displays channels organized by category rows. Operates in two modes: full-screen (normal navigation) and overlay mode (transparent panel over the active player).Interface fields
Key behaviors
- Fires
signalBeacon("AppLaunchComplete")the first time the grid becomes visible, satisfying the Roku certification requirement. - In overlay mode the background is set to
COLOR_OVERLAY(0x000000CC) so the live video below remains visible. SyncFocusToFlatIndex({flatIndex, forceTodos})scrolls the row list to the channel matching the currently playing index.RestoreOverlayContext({categoryIndex, rowIndex})restores the last manually selected row when reopening the overlay.
PlayerScreen
PlayerScreen
File:
Extends:
components/PlayerScreen/PlayerScreen.*Extends:
GroupPurpose
Live stream player. Hosts theVideo node, manages channel switching, reconnection, freeze detection, ad viewport reduction, and all player-level dialogs (offline, inactive, error).Interface fields
Key behaviors
- Starts
AdsPollingTaskandConnectivityTaskas soon as a channel is loaded. AdManageris embedded and observesadData/adsSnapshotfrom the polling task.- When
AdFormatCis active,videoHeightReductionandvideoOffsetYfields shrink theVideonode’s viewport to make room for the bottom-banner ad. - Freeze detection timer (
FREEZE_CHECK_MS = 10 000 ms) restarts the stream automatically if no position change is detected. - Network recovery: when
ConnectivityTaskreports internet restored after an outage, the player attempts a reconnect. StopVideo()is called byMainScenebefore session resets and server changes.
SettingsScreen
SettingsScreen
File:
Extends:
components/SettingsScreen/SettingsScreen.*Extends:
GroupPurpose
Configuration panel. Provides channel refresh, logout, safe-area adjustment, and a technical server management panel.Interface fields
Key behaviors
- Server panel shows profiles loaded from
GTV_LoadServerProfiles(). Each profile can be probed viaServerProbeTask. - Safe-area margin persists to registry via
GTV_RegSaveSafeMarginPct()and triggersOnSettingsSafeAreaChangedinMainScene, which callsApplySceneLayout()and relayouts all active screens. - Logout clears saved credentials and cache via
GTV_RegClearCredentials()/GTV_RegClearCache().
AdManager
AdManager
File:
Extends:
components/ads/AdManager.*Extends:
GroupPurpose
Ad lifecycle manager. Receives ad payloads fromAdsPollingTask, instantiates the correct format renderer (AdFormatA, AdFormatB, or AdFormatC), manages viewport reduction for format C, and emits metric events.Interface fields
Key behaviors
- Inspects
adPayload.format.typeto selectAdFormatA,AdFormatB, orAdFormatC. - Tracks impression start time; on teardown emits an
ad_impression_closedmetric withvisible_ms.
AdFormatA / AdFormatB / AdFormatC
AdFormatA / AdFormatB / AdFormatC
Files:
Extends:
components/ads/AdFormatA.*, AdFormatB.*, AdFormatC.*Extends:
GroupPurpose
Individual ad format renderers. Each loads a remote media URL into aPoster node and fades it in. Format C additionally reports viewport reduction values so PlayerScreen can shrink the live video to make room.Interface fields (all three formats)
Additional fields — AdFormatC only
Key children (all three)
Key behaviors
- Format A — Full-screen or large overlay image, fades in over the video.
- Format B — Partial overlay image at a configurable position and size, fades in.
- Format C — Bottom-banner image. On load, writes
videoHeightReductionandvideoOffsetYsoPlayerScreenpushes the video up to avoid overlap. - All formats fade in using a 50 ms repeating timer and fade out on teardown.