GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

BlazeSDKDelegate - iOS

The SDK triggers global delegate events that the hosting application can choose to handle.

Handlers

onEventTriggered

This delegate is Invoked when an analytics event is reported by the SDK, providing event data for insights.

/**
- eventData: All the event properties and general data
*/
public typealias OnEventTriggeredHandler = (_ eventData: BlazeAnalytics) -> Void

/// Fires every time that the sdk reports Analytics Event to the client.
public var onEventTriggered: OnEventTriggeredHandler?

onErrorThrown

This delegate is called when an error occurs within the SDK, delivering the specific error details to the application for handling.

/**
- error: The specific BlazeError that occurred within the SDK.
*/
public typealias OnErrorThrownHandler = (_ error: BlazeError) -> Void

/// Fires upon each time an error is thrown within the SDK.
public var onErrorThrown: OnErrorThrownHandler?

playbackModificationHandler

Called before playing HLS or MP4 content to allow playback modification (e.g., URL tokenization, header modification).
If not implemented, the original content will be used without modification.
Using this callback forces the player to be async.

/**
- request: Contains the original content information for playback modification.
- Returns: A response containing the modified content information to be used for playback.
*/
public typealias BlazePlaybackModificationHandler = (_ request: BlazePlaybackModificationRequest) async -> BlazePlaybackModificationResponse

/// Called before playing HLS or MP4 content to allow playback modification (e.g., URL tokenization, header modification).
/// If not implemented, the original content will be used without modification.
var playbackModificationHandler: BlazePlaybackModificationHandler?

BlazePlaybackModificationRequest

Contains information about content that needs playback modification before playing

Parameters:

  • originalURL: The original url for the playback

BlazePlaybackModificationResponse

Response object containing the modified content information to be used for playback

Parameters:

  • modifiedURL: The modified url for the playback

Convenience Extensions
/// Creates a response with modified content
/// - Parameter modifiedURL: The new URL to use for playback
/// - Returns: A response containing the modified content for playback
func response(with modifiedURL: URL? = nil) -> BlazePlaybackModificationResponse {
    return BlazePlaybackModificationResponse(modifiedURL: modifiedURL ??  originalURL)
}

onStoryPlayerDidAppear

No Longer Available: Use BlazePlayerSourceDelegate.onPlayerDidAppear instead.

func onStoryPlayerDidAppear()
ℹ️

Note: BlazeWidgetDelegate, BlazePlayerContainerDelegate, and BlazePlayerEntryPointDelegate conform to BlazePlayerSourceDelegate.

onStoryPlayerDismissed

No Longer Available: Use BlazePlayerSourceDelegate.onPlayerDidDismiss instead.

ℹ️

Note: BlazeWidgetDelegate, BlazePlayerContainerDelegate, and BlazePlayerEntryPointDelegate conform to BlazePlayerSourceDelegate.

onMomentsPlayerDidAppear

No Longer Available: Use BlazePlayerSourceDelegate.onPlayerDidAppear instead.

ℹ️

Note: BlazeWidgetDelegate, BlazePlayerContainerDelegate, and BlazePlayerEntryPointDelegate conform to BlazePlayerSourceDelegate.

onMomentsPlayerDismissed

No Longer Available: Use BlazePlayerSourceDelegate.onPlayerDidDismiss instead.

ℹ️

Note: BlazeWidgetDelegate, BlazePlayerContainerDelegate, and BlazePlayerEntryPointDelegate conform to BlazePlayerSourceDelegate.


Did this page help you?