Skip to main content

Event Interface

Breaking Change

MaestroEventInterface and MaestroEventViewModel have been removed from the public API. All methods previously called on viewModel are now called directly on the MaestroSDK.Instance returned by configure(). See the migration guide and the method pages below for updated signatures and examples.

Introduction

The SDK provides methods for letting your app notify the SDK of certain events and control UI functionalities. These methods are available directly on the MaestroSDK.Instance returned by configure().

Key Responsibilities

  • Playback Control: Notify SDK of clip playback lifecycle events
  • Panel Management: Notify SDK when panel visibility changes
  • Focus Management: Request focus changes for key plays

Methods Overview

Playback Controls

Methods for managing clip playback state.

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

Methods for managing panel visibility.

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

Focus Management

Methods for managing focus within the panel.

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

Usage Example

@Composable
fun MaestroScreen(sdk: MaestroSDK.Instance) {
// Pass sdk directly to MaestroPanel — no view model required
MaestroPanel(sdk = sdk)

// Notify SDK of playback events directly on the sdk instance
VideoPlayer(
onPlaybackStarted = { index ->
sdk.didStartPlayingClip(index)
},
onPlaybackStopped = { index ->
sdk.didStopPlayingClip(index)
},
onPlaybackProgress = { progress ->
sdk.didUpdatePlaybackProgressOfClip(progress)
},
onPlaybackFailed = { index ->
sdk.clipDidFailToPlay(index)
}
)
}