The settings panel is a full-screen overlay that floats above the player. It provides access to display configuration, account actions, and a hidden server management panel for switching between backend profiles.Documentation Index
Fetch the complete documentation index at: https://globaliptv.misidev.com/llms.txt
Use this file to discover all available pages before exploring further.
Opening and closing the settings screen
Settings can be opened from both theMainScreen overlay and the PlayerScreen. MainScene listens to the openSettings field on both screens:
MainScene restores focus to the overlay or the player depending on how settings was opened.
Safe area
The safe area margin compensates for TV overscan — some televisions crop the edges of the image. The setting is stored as a percentage (uiSafeMarginPct) and applied as an inset on all four sides of the design canvas.
- Range: 0 % to 10 % (
UI_SAFE_MARGIN_MIN_PCT/UI_SAFE_MARGIN_MAX_PCTinAppConstants.brs) - Default: 0 %
- Adjustment: Left/Right arrow keys on the focused safe area row; each press moves by 1 %.
- Persistence: Written to the Roku Registry under the key
uiSafeMarginPct(REG_KEY_SAFE_MARGIN).
safeAreaChanged fires, MainScene calls ApplySceneLayout() and re-layouts all active screens immediately.
Available actions
Channel refresh
Selecting Actualizar canales emitsrefreshChannelsRequested to MainScene, which re-runs the playlist task in "refreshCatalog" context. The channel list is re-downloaded and the player is updated to the refreshed channel at the same index (or by matching contentId if available). The settings panel is closed before the refresh starts.
Logout
Selecting Cerrar sesión emitslogoutRequested, which triggers OnLogoutRequested() in MainScene:
m.global, and navigates back to the login screen.
Main menu items
The settings menu is built dynamically byBuildMenuItems() in SettingsScreen.brs. In the default main mode the menu contains:
| Item | Key (kind) | Description |
|---|---|---|
| Área segura: N% | safeArea | Adjust the UI safe margin with arrow keys |
| Actualizar canales | refreshChannels | Re-download the channel playlist |
| Cerrar sesión | logout | Log out and clear credentials |
| Acerca de GlobalTV | about | Shows app version and support contact |
| Ver servidores | viewServers | Visible only after unlocking server admin mode |
| Cerrar | close | Close the panel and return to the player |
Server management panel
The server panel is hidden by default. It is unlocked by pressing OK on the Acerca de GlobalTV item five times (SERVER_ADMIN_UNLOCK_TAPS = 5). Once unlocked, a Ver servidores item appears in the main menu.
Server modes
The settings screen has three internal modes:| Mode | Constant | Purpose |
|---|---|---|
| Main | MODE_MAIN | Default settings menu |
| Servers | MODE_SERVERS | List of all server profiles |
| Actions | MODE_ACTIONS | Per-server actions (apply, test, edit, delete) |
Default server profiles
The default profiles are defined insource/utils/ServerManager.brs:
SERVER_LIST in AppConstants.brs. The "Local" profile is a LAN server on 172.17.11.2:3333; the "Publico" profile is the WAN endpoint at admin.globaltv.lat.
Applying a server
Selecting Aplicar ahora on a server profile emitsapplyServerRequested to MainScene, which calls ApplyServerNow(). This:
- Saves the new server URL to the Registry under
lastServer. - Updates
m.global.activeServer. - Stops the current video stream.
- Clears auth and catalog state.
- Restarts the handshake flow against the new server, followed by auto-login and playlist load.
Testing a server
Selecting Probar conexión launches aServerProbeTask that calls GTV_PingServer() against the selected server’s /health endpoint and reports the result as a status message in the detail panel — without affecting the active session.
ServerManager: LAN vs WAN selection logic
When the app needs to find a reachable server (e.g., during handshake),GTV_ServerBuildAutoProbeList() builds an ordered probe sequence that always tries LAN servers before WAN servers:
SERVER_LAN_FORCE_RETRIES = 3
LAN servers appear in the probe list SERVER_LAN_FORCE_RETRIES times (default 3) before WAN servers are tried once. With the default profiles the probe order is:
Type inference (
GTV_ServerInferType()) classifies any URL matching 172.17.*, 192.168.*, 10.*, or localhost as "lan". Everything else is classified as "wan".Registry persistence
Settings data is written to the Roku Registry under the"GlobalTV" section (REG_SECTION):
| Registry key | Constant | What is stored |
|---|---|---|
lastServer | REG_KEY_SERVER | Base URL of the last successfully used server |
serverProfiles | REG_KEY_SERVER_PROFILES | Full JSON array of server profile objects |
uiSafeMarginPct | REG_KEY_SAFE_MARGIN | Safe area margin percentage (integer, 0–10) |
FormatJson() and deserialised with ParseJson() + GTV_SanitizeServerProfiles(), which validates and deduplicates each profile on load.