Event Delegate
Introduction
The IMaestroEventDelegate
interface defines a set of methods that your application must implement to enable seamless communication between the Maestro Web SDK and your application. By implementing this interface, your application provides critical functionality, such as supplying key plays data, controlling media playback, and managing focus transitions.
Interface
export default interface IMaestroEventDelegate {
/**
* @description Allows the SDK to tell the client app that the user has encountered an error screen for lack of valid key
plays data, indicating the client app should call `updateKeyPlaysData` as soon as possible.
*/
userRequestedNewKeyPlaysData(): Promise<void>;
/**
* Allows the SDK to request the client app play a particular key plays clip, given its array index in the key plays list. Note that the `MaestroKeyPlaysResponse` subdivides the key plays by section, so the `index` referenced here assumes the client app has access to a flattened list of the key plays, disregarding the sectional subdivisions.
*/
playClip(atIndex: number): void;
/**
* @description SDK can notify the client app when its time to handle the focus management
*/
startFocusManagement(): Promise<void>;
}
Table of Contents
Key Responsibilities
Data Provision:
TheuserRequestedNewKeyPlaysData()
method allows the SDK to request fresh key plays data from your application. Your implementation should fetch the latest data and update the SDK with a call toupdateKeyPlaysData()
.Playback Control:
TheplayClip(atIndex)
method enables the SDK to instruct your application to play a specific key play clip. Your implementation should handle the actual video playback and report progress back to the SDK using methods likedidStartPlayingClip()
,didUpdatePlaybackProgressOfClip()
, anddidStopPlayingClip()
.Focus Management:
ThestartFocusManagement()
method is called when the user navigates away from the SDK UI and focus should return to your application. Your implementation should set focus to the appropriate element in your UI to ensure a seamless navigation experience. It's important to note that it releases the focus management from the SDK, allowing your application to take control of focus transitions.