Skip to main content

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.

Key Responsibilities

  • Data Provision:
    The userRequestedNewKeyPlaysData() 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 to updateKeyPlaysData().

  • Playback Control:
    The playClip(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 like didStartPlayingClip(), didUpdatePlaybackProgressOfClip(), and didStopPlayingClip().

  • Focus Management:
    The startFocusManagement() 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.

  • Bet Module API base URL:
    Due to CORS policy and security measures, the SDK expect the client App to provide the base URL to fetch the Bet from. This is specially helpful if you want to proxy the request locally using a bundler when developing local or the actual API endpoint when deployed.

Methods

MethodDescription
getBettingAPIBaseURL()Should return the Base URL to be used in the Bet module to fetch event bets.
getStatsAPIBaseURL()Should return the Base URL to be used in the Stats module to fetch event stats.
getUserSWID()Should return a Promised boolean or null value with the user's SWID.
getUserToken()Should return a Promised boolean or null value with the user's Cookie Token.
onPanelEvent(event)Send panel events to the Client App to be handle.
playClip(atIndex)Plays a video clip at the specified index.
startFocusManagement()Handles focus transfer from the SDK UI back to your application.
trackAction(action)Send User actions.
trackImpression(impression)Send Impression Events.
userIsAuthenticated()Should return a Promised boolean telling if the user is Authenticated.
userRequestedNewKeyPlaysData()Fetches fresh key plays data when requested by the user.