GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

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) -> Bool

Called 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.

Returns:

  • A boolean value indicating whether the CTA action was handled.

onTriggerPlayerBodyTextLink

method signature

fun onTriggerPlayerBodyTextLink(playerType: BlazePlayerType, sourceId: String?, actionParam: String) -> BlazeLinkActionHandleType

Called 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 BlazeLinkActionHandleType which 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 BlazeSearchHandleType indicating how to handle search, or null for 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), or null to use the SDK's default link.

Note: When using custom share links, the SDK's BlazeSDK.handleUniversalLink will 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.

PropertyTypeDescription
idStringThe unique identifier of the content being shared.
contentTypeBlazeShareContentTypeThe type of content being shared (Story, Moment, or Video).
titleString?The title of the content.
descriptionString?Optional description of the content.
sdkGeneratedLinkStringThe link that the SDK would generate by default.
extraInfoMap<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.

ValueDescription
StoryStory content type. Contains a pageId property for the specific story page.
MomentMoment content type.
VideoVideo content type.

Enums

BlazeLinkActionHandleType

A type representing the available action for handling a link trigger.

ValueDescription
WEBOpens the link in an internal web view.
DEEPLINKOpens the link in an external browser if possible.
HANDLEDDoes 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.

ValueDescription
MOMENTSRepresents a player type specifically designed for 'moments'.
STORIESRepresents a player type specifically designed for 'stories'.
VIDEOSRepresents a player type specifically designed for videos.

Did this page help you?