Skip to main content

MaestroCoreOverlays

Shows the overlays a core SDK session receives.

Overview​

MaestroCoreOverlays is a Jetpack Compose composable that draws the session's timecoded and broadcast overlays, one at a time, each at the position its config gives. Timecoded overlays follow onPlayerTimecodeUpdated(). When a viewer clicks an overlay that targets a panel, the session calls shouldShowPanel() on your delegate and selects that panel. It fills the space it is given, so place it over your player. It draws nothing below Android 9 (API 28), where Rive animations don't run.

If you need to follow the current overlay — for example, to show or hide your own player UI alongside it — use sdk.overlays with MaestroCoreOverlayView instead. Use either MaestroCoreOverlays or MaestroCoreOverlayView, never both.

Syntax​

@Composable
fun MaestroCoreOverlays(
sdk: CoreMaestroSDK.Instance,
modifier: Modifier = Modifier,
theme: MaestroThemeData = MaestroCoreTheme,
enableAutoFocus: Boolean = true,
enablePauseOnFocus: Boolean = false,
onDismiss: () -> Unit = {},
)

Parameters​

ParameterTypeDescription
sdkCoreMaestroSDK.InstanceThe session returned by configure()
modifierModifierModifier applied to the overlay area. Defaults to Modifier.
themeMaestroThemeDataTheme the overlays draw with. Defaults to MaestroCoreTheme.
enableAutoFocusBooleanMoves D-pad focus to an overlay when it appears. Defaults to true.
enablePauseOnFocusBooleanPauses an overlay while it has D-pad focus. Defaults to false.
onDismiss() -> UnitCalled when an overlay closes: the viewer presses Back or clicks it, or it ends on its own. Defaults to doing nothing.

Example​

Box(modifier = Modifier.fillMaxSize()) {
YourPlayerContent()
MaestroCorePanel(sdk = sdk, modifier = Modifier.width(300.dp).fillMaxHeight().align(Alignment.CenterEnd))
MaestroCoreOverlays(sdk = sdk)
}

To check overlays draw without waiting for a real one, call sdk.debugInterface.triggerTestOverlay().