Overlay Integration
How your channel answers overlays and handles focus around them. Assumes the setup in
Getting Started: the panel node is m.maestro, the player timecode is being sent.
Answer will-appear
Every overlay goes through onOverlayEvent
as { type, payload }. Answer will-appear at once, inside the observer, with
setDataToOverlay. Echo the overlayId so the
SDK matches your answer to the overlay.
sub onMaestroOverlayEvent(event as object)
overlayEvent = event.getData()
payload = overlayEvent?.payload
if overlayEvent?.type = "will-appear"
m.maestro.setDataToOverlay = {
overlayId: payload.overlayId
canAppear: not m.yourDialogIsOpen ' your call
canFocus: false ' show without taking focus
}
else if overlayEvent?.type = "did-dismiss"
if payload.focusRestoredBySDK <> true then m.yourFocusTarget.setFocus(true)
end if
end sub
type | When | Payload, besides overlayId and associatedPanel | Your channel |
|---|---|---|---|
will-appear | Before it shows | canAppear, canFocus: the defaults for your build | Answer with setDataToOverlay |
did-appear | It is on screen | none | Optional |
did-engage | The viewer pressed OK on it | none | Optional: the SDK opens associatedPanel and sets showPanel = true |
did-dismiss | Timeout, Back or dismissOverlay() | focusRestoredBySDK | Place focus when focusRestoredBySDK is false |
- No answer: after a timeout the SDK shows the overlay with the payload's defaults, taking focus only if the default allows it and the panel is closed. Answering at once avoids the wait.
canAppear: falseskips the overlay; the next one in the queue comes after it.canFocus: truelets the overlay take focus, even with the panel open.
Focus and keys
- A focused overlay takes OK (engage) and Back (dismiss); Back doesn't reach your channel. Other keys bubble.
- With the panel open, Left moves focus from the panel to the overlay, and Right moves it back.
- After a dismiss, the SDK restores focus itself only when the overlay held focus and the panel was open when it
appeared. Otherwise, when the overlay held focus,
focusRestoredBySDKisfalseand focus is yours to place. - With the panel open, overlays shift left to stay clear of the drawer.
To close the overlay on screen from your channel, focused or not, call
dismissOverlay(). It fires did-dismiss and returns false when no
overlay was showing.
m.maestro.callFunc("dismissOverlay")
Analytics
Overlay analytics reach your channel on trackImpression
(view, and dismiss on timeout) and trackAction
(engage), with e0_kingdom: "overlay".
Turning overlays off
| Who | How | Effect |
|---|---|---|
| Your channel, per viewer | userSettings { <panel type>: { disable_overlays: true } } | That panel's overlays are skipped; one on screen is hidden |
| Your channel, per overlay | canAppear: false in your will-appear answer | That overlay is skipped |
| Maestro, per panel | disable_overlays in the panel's config | That panel's overlays are skipped |
| Maestro, for the platform | roku.overlays.enabled: false in Maestro's global config | No overlay polling or push; the overlay on screen is dismissed |
roku.overlays.enabled is on unless set to false, and is read again each time the SDK refreshes its global config:
when it turns back on, polling resumes.
Built-in overlays from designed-panel overlay presses (Panel Layout 1.8.0) are not held to this flag: they show even
when roku.overlays.enabled is false. The viewer's disable_overlays for the panel and canAppear: false in your
will-appear answer still apply to them.
Troubleshooting
- No overlays: check that you send the player timecode
(
onPlayerTimeCodeUpdated) and thatlastDataReceivedreportsok: true. - Overlay shows late: answer
will-appearinside the observer, not from a timer.