Player

constructor(application: Application, credentialsProvider: CredentialsProvider, eventSender: EventSender, audioDecodingMode: AudioDecodingMode = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { AudioDecodingMode.BIT_PERFECT } else { AudioDecodingMode.NATIVE }, userClientIdSupplier: () -> Int? = null, bufferConfiguration: BufferConfiguration = BufferConfiguration(), assetTimeoutConfig: AssetTimeoutConfig = AssetTimeoutConfig(), streamingApiTimeoutConfig: StreamingApiTimeoutConfig = StreamingApiTimeoutConfig(), cacheProvider: CacheProvider = CacheProvider.Internal(), isOfflineMode: Boolean = false, isDebuggable: Boolean = false, okHttpClient: OkHttpClient = OkHttpClient(), playbackPrivilegeProvider: PlaybackPrivilegeProvider = object : PlaybackPrivilegeProvider { override fun get(mediaProduct: MediaProduct) = PlaybackPrivilege.OK_ONLINE }, offlinePlayProvider: OfflinePlayProvider? = null, version: String = "1.0.0")

Parameters

application

An Application to use.

credentialsProvider

A CredentialsProvider from the Auth SDK.

eventSender

An EventSender from the EventProducer SDK.

audioDecodingMode

The decoding mode to use for audio. See AudioDecodingMode for more info.

userClientIdSupplier

A function that supplies a userClientId used for event tracking. This value needs to be taken from the session. Internal use only.

bufferConfiguration

The parameters to configure different values for player buffer functionalities.

assetTimeoutConfig

The parameters to configure different values for player asset timeouts.

cacheProvider

A CacheProvider that decides if Player should use internal or external cache.

isOfflineMode

Sets initial offline mode property.

isDebuggable

A Boolean that describes if this instance is debuggable, or not.

okHttpClient

An OkHttpClient that internal logic will use as a reference to build upon. Use this if you want to share your application's OkHttpClient with us, which is recommended by OkHttpClient.

playbackPrivilegeProvider

An implementation to differentiate the way in which items can be streamed. Internal use only.

offlinePlayProvider

A means of supporting offline streaming when appropriate. Internal use only.

version

The version of the app, used for event tracking. Defaults to 1.0.0.