Class MediaSourceEventListener.EventDispatcher
- java.lang.Object
-
- com.google.android.exoplayer2.source.MediaSourceEventListener.EventDispatcher
-
- Enclosing interface:
- MediaSourceEventListener
public static class MediaSourceEventListener.EventDispatcher extends Object
Dispatches events toMediaSourceEventListeners
.
-
-
Field Summary
Fields Modifier and Type Field Description MediaSource.MediaPeriodId
mediaPeriodId
TheMediaSource.MediaPeriodId
reported with the events.int
windowIndex
The 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 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)
void
downstreamFormatChanged(MediaLoadData mediaLoadData)
void
loadCanceled(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType)
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)
void
loadCanceled(LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)
void
loadCompleted(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType)
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)
void
loadCompleted(LoadEventInfo loadEventInfo, MediaLoadData 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)
void
loadError(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType, IOException error, boolean wasCanceled)
void
loadError(LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData, IOException error, boolean wasCanceled)
void
loadStarted(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType)
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)
void
loadStarted(LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)
void
removeEventListener(MediaSourceEventListener eventListener)
Removes a listener from the event dispatcher.void
upstreamDiscarded(int trackType, long mediaStartTimeUs, long mediaEndTimeUs)
void
upstreamDiscarded(MediaLoadData 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.UsewithParameters(int, MediaPeriodId)
instead.
-
-
-
Field Detail
-
windowIndex
public final int windowIndex
The timeline window index reported with the events.
-
mediaPeriodId
@Nullable public final MediaSource.MediaPeriodId mediaPeriodId
TheMediaSource.MediaPeriodId
reported with the events.
-
-
Method Detail
-
withParameters
@CheckResult public MediaSourceEventListener.EventDispatcher withParameters(int windowIndex, @Nullable MediaSource.MediaPeriodId 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
- TheMediaSource.MediaPeriodId
to be reported with the events.- Returns:
- A view of the event dispatcher with the pre-configured parameters.
-
withParameters
@Deprecated @CheckResult public MediaSourceEventListener.EventDispatcher withParameters(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, long mediaTimeOffsetMs)
Deprecated.UsewithParameters(int, MediaPeriodId)
instead.Note: ThemediaTimeOffsetMs
passed to this method is ignored and not added to media times in any way.
-
addEventListener
public void addEventListener(Handler handler, MediaSourceEventListener 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(MediaSourceEventListener eventListener)
Removes a listener from the event dispatcher.- Parameters:
eventListener
- The listener to be removed.
-
loadStarted
public void loadStarted(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType)
-
loadStarted
public void loadStarted(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType, @com.google.android.exoplayer2.C.TrackType int trackType, @Nullable Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, @Nullable Object trackSelectionData, long mediaStartTimeUs, long mediaEndTimeUs)
-
loadStarted
public void loadStarted(LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)
-
loadCompleted
public void loadCompleted(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType)
-
loadCompleted
public void loadCompleted(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType, @com.google.android.exoplayer2.C.TrackType int trackType, @Nullable Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, @Nullable Object trackSelectionData, long mediaStartTimeUs, long mediaEndTimeUs)
-
loadCompleted
public void loadCompleted(LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)
-
loadCanceled
public void loadCanceled(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType)
-
loadCanceled
public void loadCanceled(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType, @com.google.android.exoplayer2.C.TrackType int trackType, @Nullable Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, @Nullable Object trackSelectionData, long mediaStartTimeUs, long mediaEndTimeUs)
-
loadCanceled
public void loadCanceled(LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)
-
loadError
public void loadError(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType, IOException error, boolean wasCanceled)
-
loadError
public void loadError(LoadEventInfo loadEventInfo, @com.google.android.exoplayer2.C.DataType int dataType, @com.google.android.exoplayer2.C.TrackType int trackType, @Nullable Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, @Nullable Object trackSelectionData, long mediaStartTimeUs, long mediaEndTimeUs, IOException error, boolean wasCanceled)
-
loadError
public void loadError(LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData, IOException error, boolean wasCanceled)
-
upstreamDiscarded
public void upstreamDiscarded(int trackType, long mediaStartTimeUs, long mediaEndTimeUs)
-
upstreamDiscarded
public void upstreamDiscarded(MediaLoadData mediaLoadData)
-
downstreamFormatChanged
public void downstreamFormatChanged(@com.google.android.exoplayer2.C.TrackType int trackType, @Nullable Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, @Nullable Object trackSelectionData, long mediaTimeUs)
-
downstreamFormatChanged
public void downstreamFormatChanged(MediaLoadData mediaLoadData)
-
-