DrmSessionEventListener.EventDispatcher


class DrmSessionEventListener.EventDispatcher


Dispatches events to DrmSessionEventListeners.

Summary

Public constructors

Creates an event dispatcher.

Public functions

Unit
addEventListener(
    handler: Handler!,
    eventListener: DrmSessionEventListener!
)

Adds a listener to the event dispatcher.

Unit

Dispatches onDrmKeysLoaded.

Unit

Dispatches onDrmKeysRemoved.

Unit

Dispatches onDrmKeysRestored.

Unit

Dispatches onDrmSessionAcquired.

Unit

Dispatches onDrmSessionManagerError.

Unit

Dispatches onDrmSessionReleased.

Unit

Removes a listener from the event dispatcher.

DrmSessionEventListener.EventDispatcher!
withParameters(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
)

Creates a view of the event dispatcher with the provided window index and media period id.

Public properties

MediaSource.MediaPeriodId?

The MediaPeriodId reported with the events.

Int

The timeline window index reported with the events.

Public constructors

EventDispatcher

EventDispatcher()

Creates an event dispatcher.

Public functions

addEventListener

fun addEventListener(
    handler: Handler!,
    eventListener: DrmSessionEventListener!
): Unit

Adds a listener to the event dispatcher.

Parameters
handler: Handler!

A handler on the which listener events will be posted.

eventListener: DrmSessionEventListener!

The listener to be added.

drmKeysLoaded

fun drmKeysLoaded(): Unit

Dispatches onDrmKeysLoaded.

drmKeysRemoved

fun drmKeysRemoved(): Unit

Dispatches onDrmKeysRemoved.

drmKeysRestored

fun drmKeysRestored(): Unit

Dispatches onDrmKeysRestored.

drmSessionAcquired

fun drmSessionAcquired(@DrmSession.State state: Int): Unit

Dispatches onDrmSessionAcquired.

drmSessionManagerError

fun drmSessionManagerError(error: Exception!): Unit

Dispatches onDrmSessionManagerError.

drmSessionReleased

fun drmSessionReleased(): Unit

Dispatches onDrmSessionReleased.

removeEventListener

fun removeEventListener(eventListener: DrmSessionEventListener!): Unit

Removes a listener from the event dispatcher.

Parameters
eventListener: DrmSessionEventListener!

The listener to be removed.

withParameters

fun withParameters(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
): DrmSessionEventListener.EventDispatcher!

Creates a view of the event dispatcher with the provided window index and media period id.

Parameters
windowIndex: Int

The timeline window index to be reported with the events.

mediaPeriodId: MediaSource.MediaPeriodId?

The MediaPeriodId to be reported with the events.

Returns
DrmSessionEventListener.EventDispatcher!

A view of the event dispatcher with the pre-configured parameters.

Public properties

mediaPeriodId

val mediaPeriodIdMediaSource.MediaPeriodId?

The MediaPeriodId reported with the events.

windowIndex

val windowIndexInt

The timeline window index reported with the events.