Skip to main content

API Reference

Overview

This API Reference provides detailed information on all SDK methods and resources. The methods are organized by Core SDK, Event Delegate, Maestro Event Interface, and Maestro Manager Delegate.

Core SDK

The Core SDK provides the fundamental methods for initializing and configuring the Maestro tvOS SDK. These methods serve as the entry point for integrating the SDK into your tvOS application and allow you to authenticate users, manage event lifecycles, and handle SDK configuration.

MethodDescription
configure()Initializes the Maestro tvOS SDK with required configuration parameters.
userDidStartWatchingEvent()Indicates that a user has started watching an event and initializes the event interface.
userDidStopWatchingEvent()Indicates that a user has stopped watching an event and cleans up resources.
authenticateUser()Authenticates a user with their JWT token.
deauthenticateUser()Deauthenticates the current user.
getCurrentSiteID()Retrieves the current site ID.
getCurrentJwt()Retrieves the current JWT token.
getCurrentSwid()Retrieves the current SWID.
getDefaultPanel()Retrieves the default panel type.

Event Delegate

The MaestroEventDelegate protocol defines a set of methods that your application must implement to enable seamless communication between the Maestro tvOS SDK and your application. By implementing this protocol, your application provides critical functionality, such as supplying key plays data, controlling media playback, and managing UI interactions.

MethodDescription
playClip(atIndex:)Plays a video clip at the specified index.
playPauseButtonPressed()Notifies that the play/pause button was pressed.
shouldHideOverlay()Indicates that an overlay should be hidden.
shouldHidePanel()Indicates that a panel should be hidden.
shouldShowOverlay()Indicates that an overlay should be shown.
shouldShowPanel()Indicates that a panel should be shown.
shouldShowPanelType()Indicates which panel type should be shown.
stopPlayingClip()Stops playing the current clip.
trackAction(analytics:)Send User actions.
trackImpression(analytics:)Send Impression Events.
userRequestedLogin()Indicates that the user requested to log in.
userRequestedNewKeyPlaysData()Fetches fresh key plays data when requested by the user.
userViewedPanel(panel:)Indicates that the user viewed a specific panel.

Maestro Event Interface

The Maestro Event Interface (MaestroEventInterface) defines a set of methods for interacting with the current event. These methods allow you to control panel and overlay visibility, manage playback, and access state information. The interface is implemented by the event object returned from userDidStartWatchingEvent().

Panel Management

These methods allow you to manage the visibility and behavior of the Maestro panel.

MethodDescription
currentEventDoesNotSupportKeyPlays()Indicates that the current event does not support key plays functionality.
didHidePanel()Indicates that the panel has been hidden from the user.
didShowPanel()Indicates that the panel has been shown to the user.

Overlay Management

These methods allow you to manage the visibility of overlays.

MethodDescription
didHideOverlay()Indicates that an overlay has been hidden from the user.
didShowOverlay()Indicates that an overlay has been shown to the user.

Playback Controls

These methods allow you to control and provide feedback about clip playback to the SDK.

MethodDescription
didFailToPlayClip()Indicates that a clip failed to play.
didStartPlayingClip()Indicates that a clip has started playing.
didStopPlayingClip()Indicates that a clip has stopped playing.
didUpdatePlaybackProgressOfClip()Updates the playback progress of the currently playing clip.
updatePlayerTimeCode()Updates the Player Time Code stored in the SDK.

State Access

These methods allow you to access information about the current state of the event and key plays.

EndpointDescription
getCurrentClipPlaybackProgress()Retrieves the playback progress of the currently playing clip.
getCurrentEventID()Retrieves the ID of the current event.
getCurrentlyPlayingClipIndex()Retrieves the index of the currently playing clip.
getKeyPlaysCount()Retrieves the total number of key plays available.
getLastPlayedClipIndex()Retrieves the index of the last played clip.
simulateUseCase()Simulates a specific use case for testing purposes.
updateKeyPlaysData()Updates the key plays data for the current event.

Maestro Manager Delegate

The MaestroManagerDelegate protocol defines the API with which the client app receives callbacks that are pertinent to the scope of the entire SDK, as opposed to the MaestroEventDelegate, which is scoped to the viewing of a specific event.

MethodDescription
trackAction()Track SDK-level actions.
trackState()Track SDK-level state changes.