lastDataReceived
Observable liveness signal for the live data path.
Description
Observe lastDataReceived to determine whether live panel data is actively arriving from the server, independently of what is rendered on screen. This is useful for diagnosing cases where polling has stalled or where data is being fetched but not displayed.
The field is published on every poll cycle while a panel session is active — both successful and failed requests emit a value. A run of ok: false entries is the intended signal for "no data arriving", not an error in the observer.
Nothing is published before polling starts. Polling requires both a resolved configuration and a valid player timecode, provided via onPlayerTimeCodeUpdated.
Type
assocArray
Usage
m.lib.observeField("lastDataReceived", "onLastDataReceived")
function onLastDataReceived(event as Object)
data = event.getData()
print "Live data poll: " + formatJson(data)
end function
Data Structure
| Field | Type | Description |
|---|---|---|
source | string | Which feed reported. Currently "overlay". |
timecode | string | Player timecode the poll was made against, or "" if none yet. |
bytes | integer | Response body size in bytes. 0 when nothing came back. |
ok | boolean | true if the request succeeded; false otherwise. |
Example
sub setupLivenessMonitor()
m.lib.observeField("lastDataReceived", "onLastDataReceived")
end sub
function onLastDataReceived(event as Object)
data = event.getData()
if data <> invalid then
if data.ok = true
print "Data received — source: " + data.source + ", bytes: " + data.bytes.toStr()
else
print "Poll failed — source: " + data.source
' Investigate connectivity or server availability
end if
end if
end function
Notes
- Polls run roughly every 10 seconds while a panel session is active.
- Nothing is published before polling starts, which requires both a resolved configuration and a player timecode flowing via
onPlayerTimeCodeUpdated. - Failed polls publish with
ok: falseandbytes: 0— this is expected behavior indicating a failed poll, not a problem with the observer itself. - This field is inert when unobserved; no extra work is done by the SDK unless a handler is attached.