Class DrmSessionEventListener.EventDispatcher
- java.lang.Object
-
- com.google.android.exoplayer2.drm.DrmSessionEventListener.EventDispatcher
-
- Enclosing interface:
- DrmSessionEventListener
public static class DrmSessionEventListener.EventDispatcher extends Object
Dispatches events toDrmSessionEventListeners
.
-
-
Field Summary
Fields Modifier and Type Field Description MediaSource.MediaPeriodId
mediaPeriodId
TheMediaSource.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()
void
drmKeysRemoved()
void
drmKeysRestored()
void
drmSessionAcquired(@com.google.android.exoplayer2.drm.DrmSession.State int state)
void
drmSessionManagerError(Exception error)
void
drmSessionReleased()
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.
-
-
-
Field Detail
-
windowIndex
public final int windowIndex
The timeline window index reported with the events.
-
mediaPeriodId
@Nullable public final MediaSource.MediaPeriodId mediaPeriodId
TheMediaSource.MediaPeriodId
reported with the events.
-
-
Method Detail
-
withParameters
@CheckResult public DrmSessionEventListener.EventDispatcher withParameters(int windowIndex, @Nullable MediaSource.MediaPeriodId 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
- TheMediaSource.MediaPeriodId
to be reported with the events.- Returns:
- A view of the event dispatcher with the pre-configured parameters.
-
addEventListener
public void addEventListener(Handler handler, DrmSessionEventListener 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 eventListener)
Removes a listener from the event dispatcher.- Parameters:
eventListener
- The listener to be removed.
-
drmSessionAcquired
public void drmSessionAcquired(@State @com.google.android.exoplayer2.drm.DrmSession.State int state)
-
drmKeysLoaded
public void drmKeysLoaded()
-
drmSessionManagerError
public void drmSessionManagerError(Exception error)
-
drmKeysRestored
public void drmKeysRestored()
-
drmKeysRemoved
public void drmKeysRemoved()
-
drmSessionReleased
public void drmSessionReleased()
-
-