Java Code Examples for com.google.android.exoplayer2.source.MediaSourceEventListener#LoadEventInfo

The following examples show how to use com.google.android.exoplayer2.source.MediaSourceEventListener#LoadEventInfo . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AnalyticsListenerForwarder.java    From no-player with Apache License 2.0 6 votes vote down vote up
@Override
public void onLoadError(EventTime eventTime,
                        MediaSourceEventListener.LoadEventInfo loadEventInfo,
                        MediaSourceEventListener.MediaLoadData mediaLoadData,
                        IOException error,
                        boolean wasCanceled) {
    HashMap<String, String> callingMethodParameters = new HashMap<>();

    callingMethodParameters.put(Parameters.EVENT_TIME, eventTime.toString());
    callingMethodParameters.put(Parameters.LOAD_EVENT_INFO, loadEventInfo.toString());
    callingMethodParameters.put(Parameters.MEDIA_LOAD_DATA, mediaLoadData.toString());
    callingMethodParameters.put(Parameters.ERROR, error.toString());
    callingMethodParameters.put(Parameters.WAS_CANCELED, String.valueOf(wasCanceled));

    infoListeners.onNewInfo(Methods.ON_LOAD_ERROR, callingMethodParameters);
}
 
Example 2
Source File: NoPlayerAnalyticsListener.java    From no-player with Apache License 2.0 5 votes vote down vote up
@Override
public void onLoadStarted(EventTime eventTime,
                          MediaSourceEventListener.LoadEventInfo loadEventInfo,
                          MediaSourceEventListener.MediaLoadData mediaLoadData) {
    for (AnalyticsListener listener : listeners) {
        listener.onLoadStarted(eventTime, loadEventInfo, mediaLoadData);
    }
}
 
Example 3
Source File: NoPlayerAnalyticsListener.java    From no-player with Apache License 2.0 5 votes vote down vote up
@Override
public void onLoadCompleted(EventTime eventTime,
                            MediaSourceEventListener.LoadEventInfo loadEventInfo,
                            MediaSourceEventListener.MediaLoadData mediaLoadData) {
    for (AnalyticsListener listener : listeners) {
        listener.onLoadCompleted(eventTime, loadEventInfo, mediaLoadData);
    }
}
 
Example 4
Source File: NoPlayerAnalyticsListener.java    From no-player with Apache License 2.0 5 votes vote down vote up
@Override
public void onLoadCanceled(EventTime eventTime,
                           MediaSourceEventListener.LoadEventInfo loadEventInfo,
                           MediaSourceEventListener.MediaLoadData mediaLoadData) {
    for (AnalyticsListener listener : listeners) {
        listener.onLoadCanceled(eventTime, loadEventInfo, mediaLoadData);
    }
}
 
Example 5
Source File: NoPlayerAnalyticsListener.java    From no-player with Apache License 2.0 5 votes vote down vote up
@Override
public void onLoadError(EventTime eventTime,
                        MediaSourceEventListener.LoadEventInfo loadEventInfo,
                        MediaSourceEventListener.MediaLoadData mediaLoadData,
                        IOException error,
                        boolean wasCanceled) {
    for (AnalyticsListener listener : listeners) {
        listener.onLoadError(eventTime, loadEventInfo, mediaLoadData, error, wasCanceled);
    }
}
 
Example 6
Source File: AnalyticsListenerForwarder.java    From no-player with Apache License 2.0 5 votes vote down vote up
@Override
public void onLoadStarted(EventTime eventTime,
                          MediaSourceEventListener.LoadEventInfo loadEventInfo,
                          MediaSourceEventListener.MediaLoadData mediaLoadData) {
    HashMap<String, String> callingMethodParameters = new HashMap<>();

    callingMethodParameters.put(Parameters.EVENT_TIME, eventTime.toString());
    callingMethodParameters.put(Parameters.LOAD_EVENT_INFO, loadEventInfo.toString());
    callingMethodParameters.put(Parameters.MEDIA_LOAD_DATA, mediaLoadData.toString());

    infoListeners.onNewInfo(Methods.ON_LOAD_STARTED, callingMethodParameters);
}
 
Example 7
Source File: AnalyticsListenerForwarder.java    From no-player with Apache License 2.0 5 votes vote down vote up
@Override
public void onLoadCompleted(EventTime eventTime,
                            MediaSourceEventListener.LoadEventInfo loadEventInfo,
                            MediaSourceEventListener.MediaLoadData mediaLoadData) {
    HashMap<String, String> callingMethodParameters = new HashMap<>();

    callingMethodParameters.put(Parameters.EVENT_TIME, eventTime.toString());
    callingMethodParameters.put(Parameters.LOAD_EVENT_INFO, loadEventInfo.toString());
    callingMethodParameters.put(Parameters.MEDIA_LOAD_DATA, mediaLoadData.toString());

    infoListeners.onNewInfo(Methods.ON_LOAD_COMPLETED, callingMethodParameters);
}
 
Example 8
Source File: AnalyticsListenerForwarder.java    From no-player with Apache License 2.0 5 votes vote down vote up
@Override
public void onLoadCanceled(EventTime eventTime,
                           MediaSourceEventListener.LoadEventInfo loadEventInfo,
                           MediaSourceEventListener.MediaLoadData mediaLoadData) {
    HashMap<String, String> callingMethodParameters = new HashMap<>();

    callingMethodParameters.put(Parameters.EVENT_TIME, eventTime.toString());
    callingMethodParameters.put(Parameters.LOAD_EVENT_INFO, loadEventInfo.toString());
    callingMethodParameters.put(Parameters.MEDIA_LOAD_DATA, mediaLoadData.toString());

    infoListeners.onNewInfo(Methods.ON_LOAD_CANCELED, callingMethodParameters);
}
 
Example 9
Source File: PlayerEventHandler.java    From zapp with MIT License 5 votes vote down vote up
@Override
public void onLoadError(EventTime eventTime, MediaSourceEventListener.LoadEventInfo loadEventInfo, MediaSourceEventListener.MediaLoadData mediaLoadData, IOException error, boolean wasCanceled) {
	if (wasCanceled) {
		return;
	}

	Timber.e(error, "exo player onLoadError");

	if (error instanceof HttpDataSource.HttpDataSourceException) {
		errorResourceIdSource.onNext(R.string.error_stream_io);
	} else {
		errorResourceIdSource.onNext(R.string.error_stream_unknown);
	}
}
 
Example 10
Source File: ListenerMux.java    From ExoMedia with Apache License 2.0 4 votes vote down vote up
@Override
public void onLoadError(EventTime eventTime, MediaSourceEventListener.LoadEventInfo loadEventInfo, MediaSourceEventListener.MediaLoadData mediaLoadData, IOException error, boolean wasCanceled) {
    if (analyticsListener != null) {
        analyticsListener.onLoadError(eventTime, loadEventInfo, mediaLoadData, error, wasCanceled);
    }
}
 
Example 11
Source File: ListenerMux.java    From ExoMedia with Apache License 2.0 4 votes vote down vote up
@Override
public void onLoadCanceled(EventTime eventTime, MediaSourceEventListener.LoadEventInfo loadEventInfo, MediaSourceEventListener.MediaLoadData mediaLoadData) {
    if (analyticsListener != null) {
        analyticsListener.onLoadCanceled(eventTime, loadEventInfo, mediaLoadData);
    }
}
 
Example 12
Source File: ListenerMux.java    From ExoMedia with Apache License 2.0 4 votes vote down vote up
@Override
public void onLoadCompleted(EventTime eventTime, MediaSourceEventListener.LoadEventInfo loadEventInfo, MediaSourceEventListener.MediaLoadData mediaLoadData) {
    if (analyticsListener != null) {
        analyticsListener.onLoadCompleted(eventTime, loadEventInfo, mediaLoadData);
    }
}
 
Example 13
Source File: ListenerMux.java    From ExoMedia with Apache License 2.0 4 votes vote down vote up
@Override
public void onLoadStarted(EventTime eventTime, MediaSourceEventListener.LoadEventInfo loadEventInfo, MediaSourceEventListener.MediaLoadData mediaLoadData) {
    if (analyticsListener != null) {
        analyticsListener.onLoadStarted(eventTime, loadEventInfo, mediaLoadData);
    }
}
 
Example 14
Source File: IjkExo2MediaPlayer.java    From GSYVideoPlayer with Apache License 2.0 2 votes vote down vote up
@Override
public void onLoadError(EventTime eventTime, MediaSourceEventListener.LoadEventInfo loadEventInfo, MediaSourceEventListener.MediaLoadData mediaLoadData, IOException error, boolean wasCanceled) {

}
 
Example 15
Source File: IjkExo2MediaPlayer.java    From GSYVideoPlayer with Apache License 2.0 2 votes vote down vote up
@Override
public void onLoadCanceled(EventTime eventTime, MediaSourceEventListener.LoadEventInfo loadEventInfo, MediaSourceEventListener.MediaLoadData mediaLoadData) {

}
 
Example 16
Source File: IjkExo2MediaPlayer.java    From GSYVideoPlayer with Apache License 2.0 2 votes vote down vote up
@Override
public void onLoadCompleted(EventTime eventTime, MediaSourceEventListener.LoadEventInfo loadEventInfo, MediaSourceEventListener.MediaLoadData mediaLoadData) {

}
 
Example 17
Source File: IjkExo2MediaPlayer.java    From GSYVideoPlayer with Apache License 2.0 2 votes vote down vote up
@Override
public void onLoadStarted(EventTime eventTime, MediaSourceEventListener.LoadEventInfo loadEventInfo, MediaSourceEventListener.MediaLoadData mediaLoadData) {

}