Back to Exoplayer

DrmSessionEventListener (ExoPlayer library)

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

latest8.0 KB
Original Source

Package com.google.android.exoplayer2.drm

Interface DrmSessionEventListener

  • All Known Subinterfaces:AnalyticsCollectorAll Known Implementing Classes:DefaultAnalyticsCollector, ServerSideAdInsertionMediaSource

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceDrmSessionEventListener

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

Listener of DrmSessionManager events.

Nested Class Summary

Nested Classes | Modifier and Type | Interface | Description | | --- | --- | --- | | static class | DrmSessionEventListener.EventDispatcher | Deprecated.

Dispatches events to DrmSessionEventListeners. |

Method Summary

All Methods Instance Methods Default Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | default void | onDrmKeysLoaded​(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) | Deprecated.

Called each time keys are loaded. | | default void | onDrmKeysRemoved​(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) | Deprecated.

Called each time offline keys are removed. | | default void | onDrmKeysRestored​(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) | Deprecated.

Called each time offline keys are restored. | | default void | onDrmSessionAcquired​(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) | Deprecated. Implement onDrmSessionAcquired(int, MediaPeriodId, int) instead.

| | default void | onDrmSessionAcquired​(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, @com.google.android.exoplayer2.drm.DrmSession.State int state) | Deprecated.

Called each time a drm session is acquired. | | default void | onDrmSessionManagerError​(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, Exception error) | Deprecated.

Called when a drm error occurs. | | default void | onDrmSessionReleased​(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) | Deprecated.

Called each time a drm session is released. |

Method Detail

- 

onDrmSessionAcquired

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")default void onDrmSessionAcquired​(int windowIndex,
                                  @Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId)

Deprecated. Implement onDrmSessionAcquired(int, MediaPeriodId, int) instead.

- 

onDrmSessionAcquired

default void onDrmSessionAcquired​(int windowIndex,
                                  @Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId,[@State](DrmSession.State.html "annotation in com.google.android.exoplayer2.drm")@com.google.android.exoplayer2.drm.DrmSession.State int state)

Deprecated.

Called each time a drm session is acquired. Parameters:windowIndex - The window index in the timeline this media period belongs to.mediaPeriodId - The MediaSource.MediaPeriodId associated with the drm session.state - The DrmSession.State of the session when the acquisition completed.

- 

onDrmKeysLoaded

default void onDrmKeysLoaded​(int windowIndex,
                             @Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId)

Deprecated.

Called each time keys are loaded. Parameters:windowIndex - The window index in the timeline this media period belongs to.mediaPeriodId - The MediaSource.MediaPeriodId associated with the drm session.

- 

onDrmSessionManagerError

default void onDrmSessionManagerError​(int windowIndex,
                                      @Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId,[Exception](https://developer.android.com/reference/java/lang/Exception.html "class or interface in java.lang")error)

Deprecated.

Called when a drm error occurs.

This method being called does not indicate that playback has failed, or that it will fail. The player may be able to recover from the error and continue. Hence applications should not implement this method to display a user visible error or initiate an application level retry (Player.Listener.onPlayerError(com.google.android.exoplayer2.PlaybackException) is the appropriate place to implement such behavior). This method is called to provide the application with an opportunity to log the error if it wishes to do so.

Parameters:windowIndex - The window index in the timeline this media period belongs to.mediaPeriodId - The MediaSource.MediaPeriodId associated with the drm session.error - The corresponding exception.

- 

onDrmKeysRestored

default void onDrmKeysRestored​(int windowIndex,
                               @Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId)

Deprecated.

Called each time offline keys are restored. Parameters:windowIndex - The window index in the timeline this media period belongs to.mediaPeriodId - The MediaSource.MediaPeriodId associated with the drm session.

- 

onDrmKeysRemoved

default void onDrmKeysRemoved​(int windowIndex,
                              @Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId)

Deprecated.

Called each time offline keys are removed. Parameters:windowIndex - The window index in the timeline this media period belongs to.mediaPeriodId - The MediaSource.MediaPeriodId associated with the drm session.

- 

onDrmSessionReleased

default void onDrmSessionReleased​(int windowIndex,
                                  @Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId)

Deprecated.

Called each time a drm session is released. Parameters:windowIndex - The window index in the timeline this media period belongs to.mediaPeriodId - The MediaSource.MediaPeriodId associated with the drm session.