Skip to main content

Maestro Event Interface

Introduction

The Maestro Event Interface (IMaestroEvent) defines a set of methods for interacting with the current event. These methods allow you to control panel visibility, manage playback, and access state information. The interface is implemented by the MaestroEventViewModel and is available after calling userDidStartWatchingEvent().

Interface

interface IMaestroEvent {
// Panel Management
didShowPanel(): Promise<void>;
didHidePanel(): Promise<void>;
didShowOverlay(): Promise<void>;
didHideOverlay(): Promise<void>;
currentEventDoesNotSupportKeyPlays(): void;

// Playback Controls
didStartPlayingClip(index: number): void;
didStopPlayingClip(index: number): void;
didFailToPlayClip(index: number): void;
didUpdatePlaybackProgressOfClip(index: number, to: number): void;

// State Access
getCurrentEventID(): string;
getCurrentlyPlayingClipIndex(): number | null;
getLastPlayedClipIndex(): number | null;
getCurrentClipPlaybackProgress(): number | null;
getKeyPlaysCount(): number;
updateKeyPlaysData(data: IMaestroKeyPlaysResponse | null): Promise<void>;

// Focus Management
startFocusManagement(): Promise<void>;
}

Table of Contents

Panel Management

Playback Controls

State Access

Key Responsibilities

  • Panel Management:
    Methods like didShowPanel() and didHidePanel() allow you to notify the SDK when the panel's visibility changes, enabling proper state management and analytics tracking.

  • Playback Control:
    Methods like didStartPlayingClip(), didStopPlayingClip(), and didUpdatePlaybackProgressOfClip() enable you to inform the SDK about the state of clip playback, allowing the UI to update accordingly.

  • State Access:
    Methods like getCurrentEventID(), getCurrentlyPlayingClipIndex(), and getKeyPlaysCount() provide access to the current state of the event, allowing your application to make informed decisions.

  • Data Updates:
    The updateKeyPlaysData() method allows you to update the key plays data displayed in the panel, either when new data becomes available or when the user explicitly requests a refresh.

  • Focus Management:
    The startFocusManagement() method helps manage focus transitions between the SDK UI and your application, ensuring a seamless navigation experience.

The Maestro Event Interface creates a clear contract between your application and the SDK, enabling bidirectional communication for panel management, playback control, and state access. This interface is core to the SDK's functionality and is designed to work seamlessly with the Event Delegate implementation in your application.