Player

class Player(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") : ConfigurationListener

This is the Player that will be used by apps.

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.

Constructors

Link copied to clipboard
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")

Properties

Link copied to clipboard
val configuration: <Error class: unknown class>
Link copied to clipboard
val playbackEngine: <Error class: unknown class>

Functions

Link copied to clipboard
open override fun onConfigurationChanged(configuration: Configuration)
Link copied to clipboard
fun release()

Releases any remaining resources held exclusively by this Player instance and stops any running threads that are specific to it. This instance must not be used after calling this method; instead, create any number of new instances if you need one again later on.