Logger.brs
Logger.brs
HttpClient.brs
HttpClient.brs
File: Performs an async GET. Returns:
Performs an async POST with a JSON body. Same return shape as
Builds a URL-encoded query string from an AssocArray. Values are escaped with Escapes a string using
Builds the
source/utils/HttpClient.brsPurpose
HTTP request wrapper for all backend calls. Handles TLS certificates, platform headers, user-agent, async execution, and timeout cancellation. The function signature defaults to15 000 ms; callers pass TIMEOUT_HTTP = 12 000 ms or TIMEOUT_AUTH = 15 000 ms explicitly.Functions
GTV_HttpGet.GTV_UrlEncode.roUrlTransfer.Escape().User-Agent header string.Example: GlobalTV_Roku/1.0.7 (roku; Roku Express; 12.5.0)Request headers set on every call
Timeout constants (from AppConstants)
RegistryManager.brs
RegistryManager.brs
File:
source/utils/RegistryManager.brsPurpose
Thin wrapper aroundroRegistrySection for persistent key-value storage. All reads/writes use the registry section "GlobalTV" (REG_SECTION constant). Flush is called automatically on every write.Core functions
Credential functions
Server / cache functions
Channel index functions
Safe-area margin functions
Registry key names (from AppConstants)
ServerManager.brs
ServerManager.brs
File:
source/utils/ServerManager.brsPurpose
Server list management. Maintains a list of server profiles (LAN and WAN), builds probe sequences with LAN-first retry behavior, resolves the active server, and provides CRUD operations on profiles.Key functions
Default server profiles
LAN retry behavior
SERVER_LAN_FORCE_RETRIES = 3 — the LAN server URL is inserted 3 times at the head of the probe list before WAN servers are tried. This prioritizes the local server without completely blocking on a single failure.M3UParser.brs
M3UParser.brs
File: Parses an M3U8 string. Returns:Strict mode (
When enabled (the default), any Supported
source/utils/M3UParser.brsPurpose
M3U8 playlist parser. Extracts channel metadata from#EXTINF lines and builds sorted channel and category arrays. Enforces or relaxes channel number requirements via PARSER_STRICT_CHANNEL_NUMBER.Main function
Strict mode (PARSER_STRICT_CHANNEL_NUMBER = true)
When enabled (the default), any #EXTINF entry that does not have a valid channel-number attribute greater than 0 is dropped and counted in droppedMissingNumber. Duplicate channel numbers are also dropped.When disabled, entries without a channel-number receive an auto-incremented fallback index and are counted in fallbackAssigned.Attribute extraction
Supported #EXTINF attributes
URL normalization
Stream ID extraction
Sorting
Channels are sorted ascending bychannel.number using an insertion sort (GTV_SortChannels).HealthCheck.brs
HealthCheck.brs
File: Sends an async GET to
source/utils/HealthCheck.brsPurpose
Single-function HTTP health prober. Used byServerManager, ConnectivityTask, and all tasks that need to determine whether a server is reachable before making a real request.Function
baseUrl + PATH_HEALTH (/health) with a timeout of TIMEOUT_HEALTH = 2 500 ms.Returns true if the HTTP response code is in the range 200–499 (i.e., the server is up even if it returns a client error). Returns false on timeout, connection failure, or HTTP 5xx.TLS
Forhttps:// URLs, CERTS = "common:/certs/ca-bundle.crt" is applied automatically.Usage pattern
NetworkDetector.brs
NetworkDetector.brs
File:
source/utils/NetworkDetector.brsPurpose
Device-level network state detection. UsesroDeviceInfo.GetConnectionType() to check whether the Roku device has any network interface active, without making an outbound HTTP request.Functions
Difference from HealthCheck
GTV_IsOnline() is a cheap local check (no network I/O). GTV_PingServer() makes an outbound HTTP call. ConnectivityTask uses both: GTV_IsOnline() writes to m.global.isOnline and GTV_PingServer() writes to m.global.hasInternet.