docs/doc/reference/com/google/android/exoplayer2/drm/DrmSessionEventListener.EventDispatcher.html
Package com.google.android.exoplayer2.drm
Enclosing interface:DrmSessionEventListener
public static classDrmSessionEventListener.EventDispatcherextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
Dispatches events to DrmSessionEventListeners.
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.
|
Constructors | Constructor | Description |
| --- | --- |
| EventDispatcher() |
Creates an event dispatcher.
|
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.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public final int windowIndex
The timeline window index reported with the events.
-
@Nullable
public final[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId
The MediaSource.MediaPeriodId reported with the events.
-
public EventDispatcher()
Creates an event dispatcher.
-
@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.
-
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.
-
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.
-
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).
-
public void drmKeysLoaded()
Dispatches DrmSessionEventListener.onDrmKeysLoaded(int, MediaPeriodId).
-
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).
-
public void drmKeysRestored()
Dispatches DrmSessionEventListener.onDrmKeysRestored(int, MediaPeriodId).
-
public void drmKeysRemoved()
Dispatches DrmSessionEventListener.onDrmKeysRemoved(int, MediaPeriodId).
-
public void drmSessionReleased()
Dispatches DrmSessionEventListener.onDrmSessionReleased(int, MediaPeriodId).