Event Delegate
Introduction
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.
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 toupdateKeyPlaysData().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 likedidStartPlayingClip(),didUpdatePlaybackProgressOfClip(), anddidStopPlayingClip().UI Management: Methods like
shouldShowPanel(),shouldHidePanel(),shouldShowOverlay(), andshouldHideOverlay()notify your application when the SDK needs UI elements to be shown or hidden. Your implementation should handle the actual UI presentation and dismissal.Analytics Tracking: The
trackAction(analytics:)andtrackImpression(analytics:)methods provide a mechanism for the SDK to notify your application of user actions and impressions. These notifications can be used to drive custom analytics tracking within your app.
Methods
| Method | Description |
|---|---|
| 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(id:buttonSize:) | 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. |