Skip to main content

KeyPlay States

To let the SDK display key plays, emit new items to the flow of key plays:

fun keyPlaysData(): StateFlow<MaestroLoadableResult<MaestroKeyPlaysResponse>>

The MaestroLoadableResult can represent Loading and Error states for corresponding events on the client side.

Clip playback events

Use the MaestroEventViewModel to invoke the following methods corresponding to various events related to key plays:

/** Notifies the SDK that the key play clip at [index] started playing. */
fun didStartPlayingClip(index: Int)

/** Notifies the SDK that the key play clip at [index] stopped playing. */
fun didStopPlayingClip(index: Int)

/** Notifies the SDK that the user tried to play the clip but it failed to play back.*/
fun clipDidFailToPlay(index: Int)

/** Notifies the SDK of the playback [progress] (0 to 1) of the currently-played key play clip. */
fun didUpdatePlaybackProgressOfClip(progress: Float)

/** Notifies the SDK that the key play with index [index] needs to gain focus. */
fun onKeyPlayFocusChanged(index: Int)