Interface MediaSourceEventListener
- 
- All Known Subinterfaces:
- AnalyticsCollector
 - All Known Implementing Classes:
- DefaultAnalyticsCollector,- ServerSideAdInsertionMediaSource
 
 @Deprecated public interface MediaSourceEventListener 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.Interface for callbacks to be notified ofMediaSourceevents.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classMediaSourceEventListener.EventDispatcherDeprecated.Dispatches events toMediaSourceEventListeners.
 - 
Method SummaryAll Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default voidonDownstreamFormatChanged(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, MediaLoadData mediaLoadData)Deprecated.Called when a downstream format change occurs (i.e.default voidonLoadCanceled(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)Deprecated.Called when a load is canceled.default voidonLoadCompleted(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)Deprecated.Called when a load ends.default voidonLoadError(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData, IOException error, boolean wasCanceled)Deprecated.Called when a load error occurs.default voidonLoadStarted(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)Deprecated.Called when a load begins.default voidonUpstreamDiscarded(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, MediaLoadData mediaLoadData)Deprecated.Called when data is removed from the back of a media buffer, typically so that it can be re-buffered in a different format.
 
- 
- 
- 
Method Detail- 
onLoadStarteddefault void onLoadStarted(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)Deprecated.Called when a load begins.- Parameters:
- windowIndex- The window index in the timeline of the media source this load belongs to.
- mediaPeriodId- The- MediaSource.MediaPeriodIdthis load belongs to. Null if the load does not belong to a specific media period.
- loadEventInfo- The- LoadEventInfocorresponding to the event. The value of- LoadEventInfo.uriwon't reflect potential redirection yet and- LoadEventInfo.responseHeaderswill be empty.
- mediaLoadData- The- MediaLoadDatadefining the data being loaded.
 
 - 
onLoadCompleteddefault void onLoadCompleted(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)Deprecated.Called when a load ends.- Parameters:
- windowIndex- The window index in the timeline of the media source this load belongs to.
- mediaPeriodId- The- MediaSource.MediaPeriodIdthis load belongs to. Null if the load does not belong to a specific media period.
- loadEventInfo- The- LoadEventInfocorresponding to the event. The values of- LoadEventInfo.elapsedRealtimeMsand- LoadEventInfo.bytesLoadedare relative to the corresponding- onLoadStarted(int, MediaPeriodId, LoadEventInfo, MediaLoadData)event.
- mediaLoadData- The- MediaLoadDatadefining the data being loaded.
 
 - 
onLoadCanceleddefault void onLoadCanceled(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)Deprecated.Called when a load is canceled.- Parameters:
- windowIndex- The window index in the timeline of the media source this load belongs to.
- mediaPeriodId- The- MediaSource.MediaPeriodIdthis load belongs to. Null if the load does not belong to a specific media period.
- loadEventInfo- The- LoadEventInfocorresponding to the event. The values of- LoadEventInfo.elapsedRealtimeMsand- LoadEventInfo.bytesLoadedare relative to the corresponding- onLoadStarted(int, MediaPeriodId, LoadEventInfo, MediaLoadData)event.
- mediaLoadData- The- MediaLoadDatadefining the data being loaded.
 
 - 
onLoadErrordefault void onLoadError(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData, IOException error, boolean wasCanceled)Deprecated.Called when a load error occurs.The error may or may not have resulted in the load being canceled, as indicated by the wasCanceledparameter. If the load was canceled,onLoadCanceled(int, com.google.android.exoplayer2.source.MediaSource.MediaPeriodId, com.google.android.exoplayer2.source.LoadEventInfo, com.google.android.exoplayer2.source.MediaLoadData)will not be called in addition to this method.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. 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 of the media source this load belongs to.
- mediaPeriodId- The- MediaSource.MediaPeriodIdthis load belongs to. Null if the load does not belong to a specific media period.
- loadEventInfo- The- LoadEventInfocorresponding to the event. The values of- LoadEventInfo.elapsedRealtimeMsand- LoadEventInfo.bytesLoadedare relative to the corresponding- onLoadStarted(int, MediaPeriodId, LoadEventInfo, MediaLoadData)event.
- mediaLoadData- The- MediaLoadDatadefining the data being loaded.
- error- The load error.
- wasCanceled- Whether the load was canceled as a result of the error.
 
 - 
onUpstreamDiscardeddefault void onUpstreamDiscarded(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, MediaLoadData mediaLoadData)Deprecated.Called when data is removed from the back of a media buffer, typically so that it can be re-buffered in a different format.- Parameters:
- windowIndex- The window index in the timeline of the media source this load belongs to.
- mediaPeriodId- The- MediaSource.MediaPeriodIdthe media belongs to.
- mediaLoadData- The- MediaLoadDatadefining the media being discarded.
 
 - 
onDownstreamFormatChangeddefault void onDownstreamFormatChanged(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, MediaLoadData mediaLoadData)Deprecated.Called when a downstream format change occurs (i.e. when the format of the media being read from one or moreSampleStreams provided by the source changes).- Parameters:
- windowIndex- The window index in the timeline of the media source this load belongs to.
- mediaPeriodId- The- MediaSource.MediaPeriodIdthe media belongs to.
- mediaLoadData- The- MediaLoadDatadefining the newly selected downstream data.
 
 
- 
 
-