Task node. They are created with CreateObject("roSGNode", "<TaskName>"), have their input fields set, and are started with task.control = "RUN". Completion is signaled by setting a done field or — for long-running tasks — by writing output fields that the caller observes.
AuthTask
AuthTask
File:
Function:
components/tasks/AuthTask.*Function:
RunAuthPurpose
Authenticates a username/password pair against the backend. Resolves the active server first (LAN probe → WAN fallback, up toSERVER_LAN_FORCE_RETRIES = 3 LAN attempts), then performs a GET to /auth/{user}/{pass} with TIMEOUT_AUTH = 15 000 ms.XML interface
Input fields
Output fields
Result structure
Completion signal
Observedone. When done = true, read result. result.success = true means authentication passed; result.subscriberActive confirms the subscriber account is active.Auth reason codes
PlaylistTask
PlaylistTask
File:
Function:Each entry in
components/tasks/PlaylistTask.*Function:
RunPlaylistPurpose
Downloads the authenticated M3U8 playlist from/auth/{user}/{pass}/playlist/m3u8/hls and parses it into channel and category arrays. Supports server failover: up to RETRY_MAX = 3 attempts across the server sequence.XML interface
Input fields
Output fields
Result structure
result.channels is a channel object:Completion signal
Observedone. On success, result.channels and result.categories are populated and also written directly to m.global.channelList / m.global.categories.Logging
The task logsextinf_sample lines (first 3 #EXTINF entries), a logo_summary, and up to 5 channel_sample lines at the GTV_Log level.AdsPollingTask
AdsPollingTask
File:
Function:or, if
components/tasks/AdsPollingTask.*Function:
RunAdsPollingPurpose
Long-running polling task. Performs the initial ads handshake (ifADS_HANDSHAKE_ENABLED = true), then polls the active snapshot endpoint every ADS_POLL_MS = 10 000 ms. Tracks impression versioning and signals session-level auth failures back to MainScene.XML interface
Input fields
Output fields
Completion signal
This is a long-running task; it does not use adone field. Stop it by setting control = "stop".Poll endpoint
Requests are sent toADS_API_BASE_URL + ADS_PATH_ACTIVE (default: https://ads.globaltv.lat/api/v1/app/ads/active) with query parameters:stream_id is unavailable:Handshake
Before the first poll,TryAdsHandshake() POSTs to ADS_PATH_HANDSHAKE with device and subscriber info. Failures are logged but do not block polling.ConnectivityTask
ConnectivityTask
File:
Function:
components/tasks/ConnectivityTask.*Function:
RunConnectivityTaskPurpose
Periodic network health checker. Pings the active server’s health endpoint every 10 seconds and updatesm.global.hasInternet / m.global.isOnline. Suppresses log spam by only logging on state transitions.XML interface
Fields
Completion signal
Long-running task. Stopped viacontrol = "stop". Output is written continuously to hasInternet and m.global.Check logic
HandshakeTask
HandshakeTask
File:
Function:
components/tasks/HandshakeTask.*Function:
RunHandshakePurpose
Performs the initial device handshake with the backend. Probes the server list to find a reachable endpoint, then POSTs device information toPATH_HANDSHAKE = /api/v1/app/devices/handshake. Sets m.global.activeServer, m.global.deviceId, m.global.realtimeMode, and device metadata.XML interface
Input fields
Output fields
Result structure
Completion signal
Observedone. result.success = true means the handshake succeeded. HTTP 401/403 responses set result.errorCode to that HTTP code but are treated as “auth required” (not a hard failure) by MainScene.POST payload
MetricsTask
MetricsTask
File:
Function:For impression batch events, use Impression events with
components/tasks/MetricsTask.*Function:
RunMetricsPurpose
Long-running event sink. Waits fortrackEvent field writes and POSTs each event to PATH_METRICS = /api/v1/app/metrics/track. Handles ad impression batch events separately via ADS_PATH_IMPRESSIONS.XML interface
Fields
Event object structure
eventType = "ad_impression_closed" and add:visible_ms < 1000 are silently dropped. Duplicate event_uuid values within a session are deduplicated.Completion signal
Long-running task. Stopped viacontrol = "stop". Auth failures (HTTP 401/403) permanently disable metric posting for the remainder of the session.ServerProbeTask
ServerProbeTask
File:
Function:
components/tasks/ServerProbeTask.*Function:
RunServerProbePurpose
One-shot task that probes a single server URL by callingGTV_PingServer(). Used by SettingsScreen to test connectivity to a specific server profile before applying it.XML interface
Input fields
Output fields
Result structure
success = true means GTV_PingServer() received an HTTP response in the range 200–499 within TIMEOUT_HEALTH = 2 500 ms.Completion signal
Observedone. Check result.success for the probe outcome.