docs/doc/reference/com/google/android/exoplayer2/source/MediaSourceEventListener.EventDispatcher.html
Package com.google.android.exoplayer2.source
Enclosing interface:MediaSourceEventListener
public static classMediaSourceEventListener.EventDispatcherextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
Dispatches events to MediaSourceEventListeners.
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| MediaSource.MediaPeriodId | mediaPeriodId |
The MediaSource.MediaPeriodId reported with the events.
|
| int | windowIndex |
The timeline window index reported with the events.
|
Constructors | Constructor | Description |
| --- | --- |
| EventDispatcher() |
Creates an event dispatcher.
|
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| void | addEventListener(Handler handler, MediaSourceEventListener eventListener) |
Adds a listener to the event dispatcher.
|
| void | downstreamFormatChanged(@com.google.android.exoplayer2.C.TrackType int trackType, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, Object trackSelectionData, long mediaTimeUs) |
Dispatches MediaSourceEventListener.onDownstreamFormatChanged(int, MediaPeriodId, MediaLoadData).
|
| void | downstreamFormatChanged(MediaLoadData mediaLoadData) |
Dispatches MediaSourceEventListener.onDownstreamFormatChanged(int, MediaPeriodId, MediaLoadData).
|
| void | loadCanceled(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType) |
Dispatches MediaSourceEventListener.onLoadCanceled(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
|
| void | loadCanceled(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType, @com.google.android.exoplayer2.C.TrackType int trackType, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, Object trackSelectionData, long mediaStartTimeUs, long mediaEndTimeUs) |
Dispatches MediaSourceEventListener.onLoadCanceled(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
|
| void | loadCanceled(LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) |
Dispatches MediaSourceEventListener.onLoadCanceled(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
|
| void | loadCompleted(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType) |
Dispatches MediaSourceEventListener.onLoadCompleted(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
|
| void | loadCompleted(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType, @com.google.android.exoplayer2.C.TrackType int trackType, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, Object trackSelectionData, long mediaStartTimeUs, long mediaEndTimeUs) |
Dispatches MediaSourceEventListener.onLoadCompleted(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
|
| void | loadCompleted(LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) |
Dispatches MediaSourceEventListener.onLoadCompleted(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
|
| void | loadError(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType, @com.google.android.exoplayer2.C.TrackType int trackType, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, Object trackSelectionData, long mediaStartTimeUs, long mediaEndTimeUs, IOException error, boolean wasCanceled) |
Dispatches MediaSourceEventListener.onLoadError(int, MediaPeriodId, LoadEventInfo, MediaLoadData, IOException, boolean).
|
| void | loadError(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType, IOException error, boolean wasCanceled) |
Dispatches MediaSourceEventListener.onLoadError(int, MediaPeriodId, LoadEventInfo, MediaLoadData, IOException, boolean).
|
| void | loadError(LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData, IOException error, boolean wasCanceled) |
Dispatches MediaSourceEventListener.onLoadError(int, MediaPeriodId, LoadEventInfo, MediaLoadData, IOException, boolean).
|
| void | loadStarted(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType) |
Dispatches MediaSourceEventListener.onLoadStarted(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
|
| void | loadStarted(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType, @com.google.android.exoplayer2.C.TrackType int trackType, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, Object trackSelectionData, long mediaStartTimeUs, long mediaEndTimeUs) |
Dispatches MediaSourceEventListener.onLoadStarted(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
|
| void | loadStarted(LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) |
Dispatches MediaSourceEventListener.onLoadStarted(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
|
| void | removeEventListener(MediaSourceEventListener eventListener) |
Removes a listener from the event dispatcher.
|
| void | upstreamDiscarded(int trackType, long mediaStartTimeUs, long mediaEndTimeUs) |
Dispatches MediaSourceEventListener.onUpstreamDiscarded(int, MediaPeriodId, MediaLoadData).
|
| void | upstreamDiscarded(MediaLoadData mediaLoadData) |
Dispatches MediaSourceEventListener.onUpstreamDiscarded(int, MediaPeriodId, MediaLoadData).
|
| MediaSourceEventListener.EventDispatcher | withParameters(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) |
Creates a view of the event dispatcher with pre-configured window index, media period id, and media time offset.
|
| MediaSourceEventListener.EventDispatcher | withParameters(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, long mediaTimeOffsetMs) |
Deprecated.
Use withParameters(int, MediaPeriodId) instead.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public final int windowIndex
The timeline window index reported with the events.
-
@Nullable
public final[MediaSource.MediaPeriodId](MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId
The MediaSource.MediaPeriodId reported with the events.
-
public EventDispatcher()
Creates an event dispatcher.
-
@CheckResult
public[MediaSourceEventListener.EventDispatcher](MediaSourceEventListener.EventDispatcher.html "class in com.google.android.exoplayer2.source")withParameters(int windowIndex,
@Nullable[MediaSource.MediaPeriodId](MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId)
Creates a view of the event dispatcher with pre-configured window index, media period id, and media time offset.
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.
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")@CheckResult
public[MediaSourceEventListener.EventDispatcher](MediaSourceEventListener.EventDispatcher.html "class in com.google.android.exoplayer2.source")withParameters(int windowIndex,
@Nullable[MediaSource.MediaPeriodId](MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId,
long mediaTimeOffsetMs)
Deprecated.
Use withParameters(int, MediaPeriodId) instead.
Note: The mediaTimeOffsetMs passed to this method is ignored and not added to media times in any way.
-
public void addEventListener([Handler](https://developer.android.com/reference/android/os/Handler.html "class or interface in android.os")handler,[MediaSourceEventListener](MediaSourceEventListener.html "interface in com.google.android.exoplayer2.source")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([MediaSourceEventListener](MediaSourceEventListener.html "interface in com.google.android.exoplayer2.source")eventListener)
Removes a listener from the event dispatcher.
Parameters:eventListener - The listener to be removed.
-
public void loadStarted([LoadEventInfo](LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,
@com.google.android.exoplayer2.C.DataType int dataType)
Dispatches MediaSourceEventListener.onLoadStarted(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
-
public void loadStarted([LoadEventInfo](LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,
@com.google.android.exoplayer2.C.DataType int dataType,
@com.google.android.exoplayer2.C.TrackType int trackType,
@Nullable[Format](../Format.html "class in com.google.android.exoplayer2")trackFormat,
@com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason,
@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")trackSelectionData,
long mediaStartTimeUs,
long mediaEndTimeUs)
Dispatches MediaSourceEventListener.onLoadStarted(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
-
public void loadStarted([LoadEventInfo](LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,[MediaLoadData](MediaLoadData.html "class in com.google.android.exoplayer2.source")mediaLoadData)
Dispatches MediaSourceEventListener.onLoadStarted(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
-
public void loadCompleted([LoadEventInfo](LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,
@com.google.android.exoplayer2.C.DataType int dataType)
Dispatches MediaSourceEventListener.onLoadCompleted(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
-
public void loadCompleted([LoadEventInfo](LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,
@com.google.android.exoplayer2.C.DataType int dataType,
@com.google.android.exoplayer2.C.TrackType int trackType,
@Nullable[Format](../Format.html "class in com.google.android.exoplayer2")trackFormat,
@com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason,
@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")trackSelectionData,
long mediaStartTimeUs,
long mediaEndTimeUs)
Dispatches MediaSourceEventListener.onLoadCompleted(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
-
public void loadCompleted([LoadEventInfo](LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,[MediaLoadData](MediaLoadData.html "class in com.google.android.exoplayer2.source")mediaLoadData)
Dispatches MediaSourceEventListener.onLoadCompleted(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
-
public void loadCanceled([LoadEventInfo](LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,
@com.google.android.exoplayer2.C.DataType int dataType)
Dispatches MediaSourceEventListener.onLoadCanceled(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
-
public void loadCanceled([LoadEventInfo](LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,
@com.google.android.exoplayer2.C.DataType int dataType,
@com.google.android.exoplayer2.C.TrackType int trackType,
@Nullable[Format](../Format.html "class in com.google.android.exoplayer2")trackFormat,
@com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason,
@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")trackSelectionData,
long mediaStartTimeUs,
long mediaEndTimeUs)
Dispatches MediaSourceEventListener.onLoadCanceled(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
-
public void loadCanceled([LoadEventInfo](LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,[MediaLoadData](MediaLoadData.html "class in com.google.android.exoplayer2.source")mediaLoadData)
Dispatches MediaSourceEventListener.onLoadCanceled(int, MediaPeriodId, LoadEventInfo, MediaLoadData).
-
public void loadError([LoadEventInfo](LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,
@com.google.android.exoplayer2.C.DataType int dataType,[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")error,
boolean wasCanceled)
Dispatches MediaSourceEventListener.onLoadError(int, MediaPeriodId, LoadEventInfo, MediaLoadData, IOException, boolean).
-
public void loadError([LoadEventInfo](LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,
@com.google.android.exoplayer2.C.DataType int dataType,
@com.google.android.exoplayer2.C.TrackType int trackType,
@Nullable[Format](../Format.html "class in com.google.android.exoplayer2")trackFormat,
@com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason,
@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")trackSelectionData,
long mediaStartTimeUs,
long mediaEndTimeUs,[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")error,
boolean wasCanceled)
Dispatches MediaSourceEventListener.onLoadError(int, MediaPeriodId, LoadEventInfo, MediaLoadData, IOException, boolean).
-
public void loadError([LoadEventInfo](LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,[MediaLoadData](MediaLoadData.html "class in com.google.android.exoplayer2.source")mediaLoadData,[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")error,
boolean wasCanceled)
Dispatches MediaSourceEventListener.onLoadError(int, MediaPeriodId, LoadEventInfo, MediaLoadData, IOException, boolean).
-
public void upstreamDiscarded(int trackType,
long mediaStartTimeUs,
long mediaEndTimeUs)
Dispatches MediaSourceEventListener.onUpstreamDiscarded(int, MediaPeriodId, MediaLoadData).
-
public void upstreamDiscarded([MediaLoadData](MediaLoadData.html "class in com.google.android.exoplayer2.source")mediaLoadData)
Dispatches MediaSourceEventListener.onUpstreamDiscarded(int, MediaPeriodId, MediaLoadData).
-
public void downstreamFormatChanged(@com.google.android.exoplayer2.C.TrackType int trackType,
@Nullable[Format](../Format.html "class in com.google.android.exoplayer2")trackFormat,
@com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason,
@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")trackSelectionData,
long mediaTimeUs)
Dispatches MediaSourceEventListener.onDownstreamFormatChanged(int, MediaPeriodId, MediaLoadData).
-
public void downstreamFormatChanged([MediaLoadData](MediaLoadData.html "class in com.google.android.exoplayer2.source")mediaLoadData)
Dispatches MediaSourceEventListener.onDownstreamFormatChanged(int, MediaPeriodId, MediaLoadData).