use of com.google.android.exoplayer2.Player.Listener in project ExoPlayer by google.
the class ForwardingPlayerTest method forwardingListener_overridesAllListenerMethods.
@Test
public void forwardingListener_overridesAllListenerMethods() throws Exception {
// Check with reflection that ForwardingListener overrides all Listener methods.
Class<?> forwardingListenerClass = getInnerClass("ForwardingListener");
List<Method> methods = getPublicMethods(Player.Listener.class);
for (Method method : methods) {
assertThat(forwardingListenerClass.getMethod(method.getName(), method.getParameterTypes()).getDeclaringClass()).isEqualTo(forwardingListenerClass);
}
}
use of com.google.android.exoplayer2.Player.Listener in project ExoPlayer by google.
the class DefaultAnalyticsCollector method onAudioSinkError.
@Override
public final void onAudioSinkError(Exception audioSinkError) {
EventTime eventTime = generateReadingMediaPeriodEventTime();
sendEvent(eventTime, AnalyticsListener.EVENT_AUDIO_SINK_ERROR, listener -> listener.onAudioSinkError(eventTime, audioSinkError));
}
use of com.google.android.exoplayer2.Player.Listener in project ExoPlayer by google.
the class DefaultAnalyticsCollector method onDrmSessionAcquired.
// DrmSessionEventListener implementation.
@Override
// Calls deprecated listener method.
@SuppressWarnings("deprecation")
public final void onDrmSessionAcquired(int windowIndex, @Nullable MediaPeriodId mediaPeriodId, @DrmSession.State int state) {
EventTime eventTime = generateMediaPeriodEventTime(windowIndex, mediaPeriodId);
sendEvent(eventTime, AnalyticsListener.EVENT_DRM_SESSION_ACQUIRED, listener -> {
listener.onDrmSessionAcquired(eventTime);
listener.onDrmSessionAcquired(eventTime, state);
});
}
use of com.google.android.exoplayer2.Player.Listener in project ExoPlayer by google.
the class DefaultAnalyticsCollector method onPlaybackParametersChanged.
@Override
public final void onPlaybackParametersChanged(PlaybackParameters playbackParameters) {
EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(eventTime, AnalyticsListener.EVENT_PLAYBACK_PARAMETERS_CHANGED, listener -> listener.onPlaybackParametersChanged(eventTime, playbackParameters));
}
use of com.google.android.exoplayer2.Player.Listener in project ExoPlayer by google.
the class DefaultAnalyticsCollector method onTracksInfoChanged.
@Override
public void onTracksInfoChanged(TracksInfo tracksInfo) {
EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(eventTime, AnalyticsListener.EVENT_TRACKS_CHANGED, listener -> listener.onTracksInfoChanged(eventTime, tracksInfo));
}
Aggregations