BlazePlayerSourceDelegate - Android
BlazePlayerSourceDelegate is a interface that defines the delegate methods for various player source interactions within the Blaze framework. It facilitates handling events related to data loading, player visibility, and actions within the player, customized for different player types and sources. This interface is a crucial component for managing player-related events in a robust and flexible manner.
You can implement the following methods:
onDataLoadStarted
method signature
fun onDataLoadStarted(playerType: BlazePlayerType, sourceId: String?)Called when the data loading process starts for a player of a specified type and source.
Parameters:
- playerType: The type of the player (
BlazePlayerType). - sourceId: The unique identifier of the player's source.
onDataLoadCompleted
method signature
fun onDataLoadComplete(playerType: BlazePlayerType, sourceId: String?, itemsCount: Int, result: BlazeResult)Called when the data loading process is complete for a player of a specified type and source.
Parameters:
- playerType: The type of the player (
BlazePlayerType). - sourceId: The unique identifier of the player's source.
- itemsCount: The number of items loaded.
- result: The result of the loading process, either success or failure.
onPlayerDidAppear
method signature
fun onPlayerDidAppear(playerType: BlazePlayerType, sourceId: String?)Called when a player of a specified type and source becomes visible.
Parameters:
- playerType: The type of the player (
BlazePlayerType). - sourceId: The unique identifier of the player's source.
onPlayerDidDismiss
method signature
fun onPlayerDidDismiss(playerType: BlazePlayerType, sourceId: String?)Called when a player of a specified type and source is dismissed.
Parameters:
- playerType: The type of the player (
BlazePlayerType). - sourceId: The unique identifier of the player's source.
onTriggerCTA
method signature
fun onTriggerCTA(playerType: BlazePlayerType, sourceId: String?, actionType: BlazeCTAACtionType, actionParam: String) -> BoolCalled when a CTA (Call to Action) is triggered for a player of a specified type and source.
Use it to handle CTA actions like triggering deeplinks or opening webviews, if you wish to override the default handling.
Parameters:
- playerType: The type of the player (
BlazePlayerType). - sourceId: The unique identifier of the player's source.
- actionType: The type of the action triggered (
BlazeCTAActionType). - actionParam: The parameter associated with the action.
- This is the action that is assigned to the CTA
For example: "https://dev.wsc-sports.com/docs/getting-started"
- This is the action that is assigned to the CTA
Returns:
- A boolean value indicating whether the CTA action was handled.
onTriggerPlayerBodyTextLink
method signature
fun onTriggerPlayerBodyTextLink(playerType: BlazePlayerType, sourceId: String?, actionParam: String) -> BlazeLinkActionHandleTypeCalled when a body text link is triggered for a player of a specified type and source.
Use it to handle links actions like triggering deeplinks or opening webviews, if you wish to override the default handling.
Parameters:
- playerType: The type of the player (
BlazePlayerType). - sourceId: The unique identifier of the player's source.
- actionParam: The parameter associated with the action.
Returns:
- A
BlazeLinkActionHandleTypewhich action to perform.
onPlayerEventTriggered
method signature
fun onPlayerEventTriggered(playerType: BlazePlayerType, sourceId: String?, event: BlazePlayerEvent)Called when an event is triggered for a player of a specified type and source.
Parameters:
playerType: The type of the player (BlazePlayerType).
sourceId: The unique identifier of the player's source.
event: The event that was triggered (BlazePlayerEvent).
onTriggerCustomActionButton
method signature
fun onTriggerCustomActionButton(playerType: BlazePlayerType, sourceId: String?, customParams: BlazePlayerCustomActionButtonParams)Called when a custom action button is triggered for a player of a specified type and source.
Parameters:
playerType: The type of the player (BlazePlayerType).
sourceId: The unique identifier of the player's source.
customParams: The custom parameters associated with the action (BlazePlayerCustomActionButtonParams).
onSearchButtonClicked
method signature
fun onSearchButtonClicked(playerType: BlazePlayerType, sourceId: String?): BlazeSearchHandleType?Called when the search button is clicked in a player.
Return a BlazeSearchHandleType to control the search behavior:
- BlazeSearchHandleType.BySDK: The SDK opens the search screen with the provided
BlazeSearchScreenParams. - BlazeSearchHandleType.ByApp: The SDK does nothing; the client handles the action.
- null (default): The SDK opens the search screen using the player's own data source as suggestions.
Parameters:
- playerType: The type of the player (
BlazePlayerType). - sourceId: The unique identifier of the player's source.
Returns:
- A
BlazeSearchHandleTypeindicating how to handle search, ornullfor default SDK behavior. See BlazeSearchHandleType for details.
onShareClicked
method signature
fun onShareClicked(playerType: BlazePlayerType, sourceId: String?, shareParams: BlazeShareParams): String?Called when the share button is clicked for a player of a specified type and source. Return a custom share link to override the SDK's default share link, or return null to use the SDK's internal link generator.
Parameters:
- playerType: The type of the player (
BlazePlayerType). - sourceId: The unique identifier of the player's source.
- shareParams: Parameters containing information about the content being shared (
BlazeShareParams).
Returns:
- A custom share link (
String), ornullto use the SDK's default link.
Note: When using custom share links, the SDK's
BlazeSDK.handleUniversalLinkwill not be able to parse them. Your app must handle these links on its own by parsing the URL and calling the appropriate entry point methods directly (e.g.BlazeSDK.playStory,BlazeSDK.playMoment,BlazeSDK.playVideo).
Models
BlazeShareParams
Parameters provided to the app when the share button is clicked.
| Property | Type | Description |
|---|---|---|
| id | String | The unique identifier of the content being shared. |
| contentType | BlazeShareContentType | The type of content being shared (Story, Moment, or Video). |
| title | String? | The title of the content. |
| description | String? | Optional description of the content. |
| sdkGeneratedLink | String | The link that the SDK would generate by default. |
| extraInfo | Map<String, String> | Content-level extra info metadata for the shared item. For Stories this is the story's extra info; for Moments and Videos it is the item's own extra info. Defaults to an empty map when the content has no extra info. Always populated — not gated by the analyticsAddExtraInfo remote flag. |
BlazeShareContentType
A sealed interface representing the type of content being shared.
| Value | Description |
|---|---|
| Story | Story content type. Contains a pageId property for the specific story page. |
| Moment | Moment content type. |
| Video | Video content type. |
Enums
BlazeLinkActionHandleType
A type representing the available action for handling a link trigger.
| Value | Description |
|---|---|
| WEB | Opens the link in an internal web view. |
| DEEPLINK | Opens the link in an external browser if possible. |
| HANDLED | Does nothing since the link has been handled already. |
BlazePlayerType
BlazePlayerType is an enumeration within the Blaze framework that categorizes different types of players. It is essential for distinguishing various player styles and functionalities, thereby enabling specific behaviors and features for each type.
| Value | Description |
|---|---|
| MOMENTS | Represents a player type specifically designed for 'moments'. |
| STORIES | Represents a player type specifically designed for 'stories'. |
| VIDEOS | Represents a player type specifically designed for videos. |
Updated 22 days ago
