BroadpeakPlayerBuilder

A PlayerBuilder implementation for constructing a BroadpeakPlayer instance.

This builder handles the specific requirements for playback with Broadpeak's server-side ad insertion (SSAI). It creates a streaming session, and retrieves the manipulated manifest URL for playback.

The builder configures the underlying player with the necessary parameters like media URL (obtained from Broadpeak), DRM information, and media type. It also sets up policies and handlers for ad playback.

Example usage:

val broadpeakPlayer = BroadpeakPlayerBuilder()
.adPlaybackPolicy(customAdPolicy)
.build(
platformContext,
contentAuthToken,
consumptionType
)
}

NOTE: BroadpeakPlayer ad insertion enablement depends on successful SmartLib initialization that MUST be done prior to building the BroadpeakPlayer. The best practice is to call BroadpeakSessionManager.createInstance(broadpeakInitData) when application is starting so Android Application.onCreate() is the optimal place as a starting point for Broadpeak initialization.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun adParams(adParams: Map<String, String>): <Error class: unknown class>

Sets parameters used for the ad insertion.

Link copied to clipboard
fun adPlaybackPolicy(adPlaybackPolicy: AdPlaybackPolicy): <Error class: unknown class>

Configures the AdPlaybackPolicy instance that defines the set of policy rules for Ads handling

Link copied to clipboard
open override fun build(platformContext: <Error class: unknown class>): Player

fun build(platformContext: <Error class: unknown class>, consumptionType: ConsumptionType): BroadpeakPlayer

DEVELOPER NOTE: This is overloaded version of the build function that handles clear content and should be used mainly for testing purposes.

Link copied to clipboard
Link copied to clipboard
fun customParams(customParams: Map<String, String>): <Error class: unknown class>

Set custom parameters to be added to the session report.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun excludeMediaSession(excludeMediaSession: Boolean): PlayerBuilder
Link copied to clipboard
fun initializationUrl(initializationUrl: String): <Error class: unknown class>

Set broadpeak initializationUrl.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun palConfiguration(palConfiguration: PALConfiguration): <Error class: unknown class>

Sets the PALConfiguration instance that is used in the PALSession initialization.

Link copied to clipboard
fun pipSession(pipSession: Boolean): <Error class: unknown class>

Set whether broadpeak session should also work in mode.

Link copied to clipboard
fun playbackPolicyHandler(playbackPolicyHandler: PlaybackPolicyHandler): <Error class: unknown class>

Sets the PlaybackPolicyHandler instance that enforces the policy rules related to the content with MediaTailor ads.

Link copied to clipboard
fun playbackPolicyHandlerListener(playbackPolicyHandlerListener: PlaybackPolicyHandler.Listener): <Error class: unknown class>

Sets the PlaybackPolicyHandler.Listener instance that provides the notification for ad playback policy related events.

Link copied to clipboard
Link copied to clipboard
fun preferredAudioMimeTypes(preferredAudioMimeTypes: Array<String>): PlayerBuilder
Link copied to clipboard
Link copied to clipboard
fun preferredVideoMimeTypes(preferredVideoMimeTypes: Array<String>): PlayerBuilder
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun thumbnailPreviewProperties(thumbnailPreviewEndpointUrl: String, maxConcurrentThumbnailDownloads: Int?, thumbnailPreviewConfig: ThumbnailPreviewConfig?): PlayerBuilder
Link copied to clipboard