Skip to main content

onEventDataUpdated

Notifies the SDK about the new state of the currently-played event.

Overview

Call this method whenever the event being played changes. This includes starting to play a new event, switching between events, or stopping event playback. The SDK uses this information to load event-specific data and update its UI accordingly.

Syntax

fun onEventDataUpdated(data: MaestroEventData?)

Parameters

ParameterTypeDescription
dataMaestroEventData?Event data for the currently playing event, or null if no event is playing

Example

// When starting to play an event
fun onEventStarted(eventId: String) {
val eventData = MaestroEventData(
eventId = eventId,
// Other event metadata
)
sdk.onEventDataUpdated(eventData)
}

// When stopping event playback
fun onEventStopped() {
sdk.onEventDataUpdated(null)
}

// When switching to a different event
fun onEventChanged(newEventId: String) {
val newEventData = MaestroEventData(
eventId = newEventId,
)
sdk.onEventDataUpdated(newEventData)
}

Notes

  • Call this method whenever the active event changes
  • Pass null when no event is currently playing
  • The SDK uses this to load event-specific content (key plays, stats, etc.)
  • This method should be called before requesting event-specific features
  • Changes to event data will trigger updates throughout the SDK UI
  • MaestroEventData must have a non-blank metadataValue to trigger event-specific content loading; a non-null object with a blank metadataValue is treated the same as null
info

Pass null when the user stops watching an event. This ensures correct cancellation of any background work the SDK is performing for that event. Passing a MaestroEventData object with a blank metadataValue is equivalent to passing null — no event-specific content is loaded and any active event state is cleared.

  • configure() - Initial SDK configuration which can include event data