public class

DrmSessionEventListener.EventDispatcher

extends java.lang.Object

 java.lang.Object

↳androidx.media3.exoplayer.drm.DrmSessionEventListener.EventDispatcher

Overview

Dispatches events to DrmSessionEventListeners.

Summary

Fields
public final MediaSource.MediaPeriodIdmediaPeriodId

The MediaSource.MediaPeriodId reported with the events.

public final intwindowIndex

The timeline window index reported with the events.

Constructors
publicEventDispatcher()

Creates an event dispatcher.

Methods
public voidaddEventListener(Handler handler, DrmSessionEventListener eventListener)

Adds a listener to the event dispatcher.

public voiddrmKeysLoaded()

Dispatches DrmSessionEventListener.EventDispatcher.

public voiddrmKeysRemoved()

Dispatches DrmSessionEventListener.EventDispatcher.

public voiddrmKeysRestored()

Dispatches DrmSessionEventListener.EventDispatcher.

public voiddrmSessionAcquired(int state)

Dispatches DrmSessionEventListener.EventDispatcher and DrmSessionEventListener.EventDispatcher.

public voiddrmSessionManagerError(java.lang.Exception error)

Dispatches DrmSessionEventListener.EventDispatcher.

public voiddrmSessionReleased()

Dispatches DrmSessionEventListener.EventDispatcher.

public voidremoveEventListener(DrmSessionEventListener eventListener)

Removes a listener from the event dispatcher.

public DrmSessionEventListener.EventDispatcherwithParameters(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId)

Creates a view of the event dispatcher with the provided window index and media period id.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public final int windowIndex

The timeline window index reported with the events.

public final MediaSource.MediaPeriodId mediaPeriodId

The MediaSource.MediaPeriodId reported with the events.

Constructors

public EventDispatcher()

Creates an event dispatcher.

Methods

public DrmSessionEventListener.EventDispatcher withParameters(int windowIndex, 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: 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 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.

public void removeEventListener(DrmSessionEventListener eventListener)

Removes a listener from the event dispatcher.

Parameters:

eventListener: The listener to be removed.

public void drmSessionAcquired(int state)

Dispatches DrmSessionEventListener.EventDispatcher and DrmSessionEventListener.EventDispatcher.

public void drmKeysLoaded()

Dispatches DrmSessionEventListener.EventDispatcher.

public void drmSessionManagerError(java.lang.Exception error)

Dispatches DrmSessionEventListener.EventDispatcher.

public void drmKeysRestored()

Dispatches DrmSessionEventListener.EventDispatcher.

public void drmKeysRemoved()

Dispatches DrmSessionEventListener.EventDispatcher.

public void drmSessionReleased()

Dispatches DrmSessionEventListener.EventDispatcher.