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.MediaPeriodIdmediaPeriodIdTheMediaSource.MediaPeriodIdreported with the events.intwindowIndexThe 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 voidaddEventListener(Handler handler, DrmSessionEventListener eventListener)Adds a listener to the event dispatcher.voiddrmKeysLoaded()voiddrmKeysRemoved()voiddrmKeysRestored()voiddrmSessionAcquired(@com.google.android.exoplayer2.drm.DrmSession.State int state)voiddrmSessionManagerError(Exception error)voiddrmSessionReleased()voidremoveEventListener(DrmSessionEventListener eventListener)Removes a listener from the event dispatcher.DrmSessionEventListener.EventDispatcherwithParameters(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.MediaPeriodIdreported 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.MediaPeriodIdto 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()
-
-