Reference for all constants defined in AppConstants() in source/AppConstants.brs.
source/AppConstants.brs exposes a single function AppConstants() that returns an associative array of every tunable value in the application. Centralizing configuration here avoids magic numbers scattered across the codebase and makes it easy to audit and update values before a release.
source/AppConstants.brs
Copy
Ask AI
function AppConstants() as Object return { ' ... all constants ... }end function
Call AppConstants() anywhere in BrightScript to get a fresh copy of the table. There is no global singleton — the AA is constructed on each call.
Ordered list of backend servers. Index 0 is the LAN server; index 1 is the production server. The app tries servers in order and falls back on failure.
PATH_HEALTH
/health
Health-check endpoint. Polled to determine if a server is reachable before attempting auth.
PATH_HANDSHAKE
/api/v1/app/devices/handshake
Device handshake endpoint called at startup to register the device.
PATH_AUTH_TPL
/auth/{user}/{pass}
URL template for authentication. {user} and {pass} are substituted at runtime.
PATH_PLAYLIST_TPL
/auth/{user}/{pass}/playlist/m3u8/hls
URL template for fetching the HLS channel playlist after successful auth.
PATH_ADS
/api/v1/app/ads/active
Endpoint for fetching the current active ad snapshot from the main backend.
PATH_METRICS
/api/v1/app/metrics/track
Endpoint for posting playback and engagement metrics.
SERVER_LIST[0] (172.17.11.2:3333) is a LAN address intended for local development. In production environments the app selects the best available server from the list based on health-check results.
The Roku registry is persistent key-value storage that survives channel reinstalls. All GlobalTV registry entries are stored under the GlobalTV section.
Constant
Value
Description
REG_SECTION
"GlobalTV"
Registry section name under which all keys are stored.
REG_KEY_USER
"username"
Stores the authenticated username.
REG_KEY_PASS
"password"
Stores the authenticated password.
REG_KEY_SERVER
"lastServer"
Stores the URL of the last successfully used server.
REG_KEY_CHANNEL
"lastChannelIndex"
Stores the index of the last watched channel for auto-resume.
REG_KEY_SAFE_MARGIN
"uiSafeMarginPct"
Stores the user-configured safe area margin percentage (0–10).
REG_KEY_SERVER_PROFILES
"serverProfiles"
Stores serialized server profile data for the server management panel.
These codes are returned by GTV_AuthClassifyFailure() to describe why an authentication attempt failed. They are used to drive the error messaging shown to the user.
Constant
Value
Description
AUTH_REASON_NONE
0
Auth succeeded or failure reason is unknown.
AUTH_REASON_NETWORK_DOWN
460
HTTP response code -1 — no network connectivity.
AUTH_REASON_CREDENTIALS
401
Bad username or password (HTTP 401, 403, 404, or credential signal in response body).
AUTH_REASON_INACTIVE
470
Account exists but subscriber is inactive or disabled.
AUTH_REASON_PASSWORD_CHANGED
471
Session was revoked because the password was changed or reset.
Duration the in-app splash screen is displayed. Matches splash_min_time in the manifest.
BANNER_MS
3000 ms
Duration a notification banner stays visible before auto-dismissing.
BANNER_FADE_MS
300 ms
Duration of the banner fade-out animation.
CHANNEL_BUF_MS
1200 ms
Buffer delay before switching to a new channel, preventing rapid flipping from triggering unnecessary stream loads.
Safe area
Constant
Value
Description
UI_SAFE_MARGIN_PCT
0
Default safe area margin as a percentage of the screen dimension. 0 means no margin applied by default.
UI_SAFE_MARGIN_MIN_PCT
0
Minimum allowed safe area margin. Enforced by GTV_GetSafeMarginPct().
UI_SAFE_MARGIN_MAX_PCT
10
Maximum allowed safe area margin. User-configurable up to 10% via the Settings screen.
The user-configured value is persisted to the registry under REG_KEY_SAFE_MARGIN and read back by GTV_GetSafeMarginPct() at runtime, which clamps it to [UI_SAFE_MARGIN_MIN_PCT, UI_SAFE_MARGIN_MAX_PCT].
Channel grid
Constant
Value
Description
CHANNEL_TILE_MODE
"badge_only"
Controls how channel tiles are rendered in the main grid. badge_only shows only the channel number badge without artwork.
PARSER_STRICT_CHANNEL_NUMBER
true
When true, the playlist parser rejects channels with non-numeric or missing channel numbers rather than assigning a fallback value.
Diagnostic flags
Constant
Value
Description
LAYOUT_DIAG
false
Enables verbose layout diagnostics printed to the telnet log via GTV_LayoutPrint().
MAINSCREEN_GRID_DIAG
false
Enables grid layout diagnostic output in MainScreen.
ADS_FLOW_DIAG
false
Enables ad flow diagnostic output in the ads subsystem.
Set any of these to true locally to trace layout or ads behavior. All three default to false and should remain false in production builds.