Back to Exoplayer

DrmSessionEventListener.EventDispatcher (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/drm/DrmSessionEventListener.EventDispatcher.html

latest8.2 KB
Original Source

Package com.google.android.exoplayer2.drm

Class DrmSessionEventListener.EventDispatcher


public static classDrmSessionEventListener.EventDispatcherextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

Dispatches events to DrmSessionEventListeners.

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | MediaSource.MediaPeriodId | mediaPeriodId | The MediaSource.MediaPeriodId reported with the events. | | int | windowIndex | The timeline window index reported with the events. |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | EventDispatcher() | Creates an event dispatcher. |

Method Summary

All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | addEventListener​(Handler handler, DrmSessionEventListener eventListener) | Adds a listener to the event dispatcher. | | void | drmKeysLoaded() | Dispatches DrmSessionEventListener.onDrmKeysLoaded(int, MediaPeriodId). | | void | drmKeysRemoved() | Dispatches DrmSessionEventListener.onDrmKeysRemoved(int, MediaPeriodId). | | void | drmKeysRestored() | Dispatches DrmSessionEventListener.onDrmKeysRestored(int, MediaPeriodId). | | void | drmSessionAcquired​(@com.google.android.exoplayer2.drm.DrmSession.State int state) | Dispatches DrmSessionEventListener.onDrmSessionAcquired(int, MediaPeriodId, int) and DrmSessionEventListener.onDrmSessionAcquired(int, MediaPeriodId). | | void | drmSessionManagerError​(Exception error) | Dispatches DrmSessionEventListener.onDrmSessionManagerError(int, MediaPeriodId, Exception). | | void | drmSessionReleased() | Dispatches DrmSessionEventListener.onDrmSessionReleased(int, MediaPeriodId). | | void | removeEventListener​(DrmSessionEventListener eventListener) | Removes a listener from the event dispatcher. | | DrmSessionEventListener.EventDispatcher | withParameters​(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) | Creates a view of the event dispatcher with the provided window index and media period id. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

- 

windowIndex

public final int windowIndex

The timeline window index reported with the events.

- 

mediaPeriodId

@Nullable
public final[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId

The MediaSource.MediaPeriodId reported with the events.

Constructor Detail

- 

EventDispatcher

public EventDispatcher()

Creates an event dispatcher.

Method Detail

- 

withParameters

@CheckResult
public[DrmSessionEventListener.EventDispatcher](DrmSessionEventListener.EventDispatcher.html "class in com.google.android.exoplayer2.drm")withParameters​(int windowIndex,
                                                              @Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId)

Creates a view of the event dispatcher with the provided window index and media period id. Parameters:windowIndex - The timeline window index to be reported with the events.mediaPeriodId - The MediaSource.MediaPeriodId to be reported with the events.Returns:A view of the event dispatcher with the pre-configured parameters.

- 

addEventListener

public void addEventListener​([Handler](https://developer.android.com/reference/android/os/Handler.html "class or interface in android.os")handler,[DrmSessionEventListener](DrmSessionEventListener.html "interface in com.google.android.exoplayer2.drm")eventListener)

Adds a listener to the event dispatcher. Parameters:handler - A handler on the which listener events will be posted.eventListener - The listener to be added.

- 

removeEventListener

public void removeEventListener​([DrmSessionEventListener](DrmSessionEventListener.html "interface in com.google.android.exoplayer2.drm")eventListener)

Removes a listener from the event dispatcher. Parameters:eventListener - The listener to be removed.

- 

drmSessionAcquired

public void drmSessionAcquired​([@State](DrmSession.State.html "annotation in com.google.android.exoplayer2.drm")@com.google.android.exoplayer2.drm.DrmSession.State int state)

Dispatches DrmSessionEventListener.onDrmSessionAcquired(int, MediaPeriodId, int) and DrmSessionEventListener.onDrmSessionAcquired(int, MediaPeriodId).

- 

drmKeysLoaded

public void drmKeysLoaded()

Dispatches DrmSessionEventListener.onDrmKeysLoaded(int, MediaPeriodId).

- 

drmSessionManagerError

public void drmSessionManagerError​([Exception](https://developer.android.com/reference/java/lang/Exception.html "class or interface in java.lang")error)

Dispatches DrmSessionEventListener.onDrmSessionManagerError(int, MediaPeriodId, Exception).

- 

drmKeysRestored

public void drmKeysRestored()

Dispatches DrmSessionEventListener.onDrmKeysRestored(int, MediaPeriodId).

- 

drmKeysRemoved

public void drmKeysRemoved()

Dispatches DrmSessionEventListener.onDrmKeysRemoved(int, MediaPeriodId).

- 

drmSessionReleased

public void drmSessionReleased()

Dispatches DrmSessionEventListener.onDrmSessionReleased(int, MediaPeriodId).