Skip to main content

SDK Instance

Introduction​

The MaestroSDKInstance class represents a single initialized Maestro SDK session. It is returned by the configure call from the MaestroManager and provides methods for managing the SDK lifecycle and notifying the SDK of application events.

Instance Methods​

Lifecycle & Configuration​

MethodDescription
setDataToPanel()Set custom data to a panel - mostly for debugging/testing purposes
onEventDataUpdated()Notifies SDK about new event state
updateConfig()Updates user-specific SDK configuration
onPlayerTimecodeUpdated()Notifies SDK of play-head time-code updates
detach()Detaches SDK and stops all work

Playback Controls​

MethodDescription
didStartPlayingClip()Notifies SDK that a clip started playing
didStopPlayingClip()Notifies SDK that a clip stopped playing
clipDidFailToPlay()Notifies SDK that a clip failed to play
didUpdatePlaybackProgressOfClip()Notifies SDK of clip playback progress

Panel Management​

MethodDescription
didShowPanel()Notifies SDK that the panel was displayed
didHidePanel()Notifies SDK that the panel was hidden

Focus Management​

MethodDescription
onKeyPlayFocusChanged()Notifies SDK that a key play needs to gain focus

Properties​

PropertyTypeDescription
debugInterfaceMaestroSDKDebugInterfaceDebug and testing utilities (lazy-initialized)
availablePanelsFlow<MaestroPanelAvailability>Emits the panels available for the current event in tab order
selectedPanelFlow<MaestroPanelType?>Emits the panel tab the SDK currently displays

Example Usage​

// Configure SDK to get instance
val sdk = MaestroSDK.configure(
context = applicationContext,
maestroEventDelegate = this,
params = MaestroSDKParameters(siteId = "your-site-id"),
)

// Use instance methods
sdk.onEventDataUpdated(eventData)
sdk.onPlayerTimecodeUpdated(currentTimeMillis)

// Notify SDK of playback events
sdk.didStartPlayingClip(index)
sdk.didUpdatePlaybackProgressOfClip(progress)
sdk.didStopPlayingClip(index)

// Notify SDK of panel visibility
sdk.didShowPanel(MaestroPanelType.Stats)
sdk.didHidePanel()

// Clean up
sdk.detach()