DrmSessionEventListener


@UnstableApi
interface DrmSessionEventListener

Known direct subclasses
AnalyticsCollector

Interface for data collectors that forward analytics events to AnalyticsListeners.

ServerSideAdInsertionMediaSource

A MediaSource for server-side inserted ad breaks.

Known indirect subclasses
DefaultAnalyticsCollector

Data collector that forwards analytics events to AnalyticsListeners.


Listener of DrmSessionManager events.

Summary

Nested types

Dispatches events to DrmSessionEventListeners.

Public functions

Unit
onDrmKeysLoaded(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
)

Called each time keys are loaded.

Unit
onDrmKeysRemoved(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
)

Called each time offline keys are removed.

Unit
onDrmKeysRestored(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
)

Called each time offline keys are restored.

Unit
onDrmSessionAcquired(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
)

This function is deprecated.

Implement onDrmSessionAcquired instead.

Unit
onDrmSessionAcquired(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?,
    @DrmSession.State state: Int
)

Called each time a drm session is acquired.

Unit
onDrmSessionManagerError(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?,
    error: Exception!
)

Called when a drm error occurs.

Unit
onDrmSessionReleased(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
)

Called each time a drm session is released.

Public functions

onDrmKeysLoaded

fun onDrmKeysLoaded(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
): Unit

Called each time keys are loaded.

Parameters
windowIndex: Int

The window index in the timeline this media period belongs to.

mediaPeriodId: MediaSource.MediaPeriodId?

The MediaPeriodId associated with the drm session.

onDrmKeysRemoved

fun onDrmKeysRemoved(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
): Unit

Called each time offline keys are removed.

Parameters
windowIndex: Int

The window index in the timeline this media period belongs to.

mediaPeriodId: MediaSource.MediaPeriodId?

The MediaPeriodId associated with the drm session.

onDrmKeysRestored

fun onDrmKeysRestored(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
): Unit

Called each time offline keys are restored.

Parameters
windowIndex: Int

The window index in the timeline this media period belongs to.

mediaPeriodId: MediaSource.MediaPeriodId?

The MediaPeriodId associated with the drm session.

onDrmSessionAcquired

fun onDrmSessionAcquired(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
): Unit

onDrmSessionAcquired

fun onDrmSessionAcquired(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?,
    @DrmSession.State state: Int
): Unit

Called each time a drm session is acquired.

Parameters
windowIndex: Int

The window index in the timeline this media period belongs to.

mediaPeriodId: MediaSource.MediaPeriodId?

The MediaPeriodId associated with the drm session.

@DrmSession.State state: Int

The DrmSession.State of the session when the acquisition completed.

onDrmSessionManagerError

fun onDrmSessionManagerError(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?,
    error: Exception!
): Unit

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 (onPlayerError 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: Int

The window index in the timeline this media period belongs to.

mediaPeriodId: MediaSource.MediaPeriodId?

The MediaPeriodId associated with the drm session.

error: Exception!

The corresponding exception.

onDrmSessionReleased

fun onDrmSessionReleased(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
): Unit

Called each time a drm session is released.

Parameters
windowIndex: Int

The window index in the timeline this media period belongs to.

mediaPeriodId: MediaSource.MediaPeriodId?

The MediaPeriodId associated with the drm session.