Skip to main content

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
typeWhenPayload, besides overlayId and associatedPanelYour channel
will-appearBefore it showscanAppear, canFocus: the defaults for your buildAnswer with setDataToOverlay
did-appearIt is on screennoneOptional
did-engageThe viewer pressed OK on itnoneOptional: the SDK opens associatedPanel and sets showPanel = true
did-dismissTimeout, Back or dismissOverlay()focusRestoredBySDKPlace 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: false skips the overlay; the next one in the queue comes after it.
  • canFocus: true lets 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, focusRestoredBySDK is false and 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​

WhoHowEffect
Your channel, per vieweruserSettings { <panel type>: { disable_overlays: true } }That panel's overlays are skipped; one on screen is hidden
Your channel, per overlaycanAppear: false in your will-appear answerThat overlay is skipped
Maestro, per paneldisable_overlays in the panel's configThat panel's overlays are skipped
Maestro, for the platformroku.overlays.enabled: false in Maestro's global configNo 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 that lastDataReceived reports ok: true.
  • Overlay shows late: answer will-appear inside the observer, not from a timer.