PillarboxExoPlayer

fun PillarboxExoPlayer(context: Context, builder: SRG.Builder.() -> Unit = {}): PillarboxExoPlayer

Creates a PillarboxExoPlayer instance configured for the SRG SSR.

Basic usage

val srgPlayer = PillarboxExoPlayer(context)

This creates a player with the default SRG SSR configuration:

  • Automatic integration with Pillarbox Monitoring: playback events are sent to a predefined endpoint.

  • SRG Asset Loader: integrates an SRGAssetLoader for handling SRG-specific media resources. If not explicitly configured, a default instance is created.

Custom configuration

val customSrgPlayer = PillarboxExoPlayer(context) {
srgAssetLoader(context) {
mediaCompositionService(CustomMediaCompositionService())
}
}

Return

A configured PillarboxExoPlayer instance ready for playback.

Parameters

context

The Context of the application.

builder

An optional lambda with a receiver of type SRG.Builder allowing customization of the player's configuration.