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
| Method | Description |
|---|---|
| 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
| Method | Description |
|---|---|
| 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
| Method | Description |
|---|---|
| didShowPanel() | Notifies SDK that the panel was displayed |
| didHidePanel() | Notifies SDK that the panel was hidden |
Focus Management
| Method | Description |
|---|---|
| onKeyPlayFocusChanged() | Notifies SDK that a key play needs to gain focus |
Properties
| Property | Type | Description |
|---|---|---|
debugInterface | MaestroSDKDebugInterface | Debug and testing utilities (lazy-initialized) |
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()