Search in sources :

Example 86 with EventTime

use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.

the class DefaultAnalyticsCollector method onVideoSizeChanged.

// Calling deprecated listener method.
@SuppressWarnings("deprecation")
@Override
public final void onVideoSizeChanged(VideoSize videoSize) {
    EventTime eventTime = generateReadingMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_VIDEO_SIZE_CHANGED, listener -> {
        listener.onVideoSizeChanged(eventTime, videoSize);
        listener.onVideoSizeChanged(eventTime, videoSize.width, videoSize.height, videoSize.unappliedRotationDegrees, videoSize.pixelWidthHeightRatio);
    });
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 87 with EventTime

use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.

the class DefaultAnalyticsCollector method onPlaylistMetadataChanged.

@Override
public void onPlaylistMetadataChanged(MediaMetadata playlistMetadata) {
    EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_PLAYLIST_METADATA_CHANGED, listener -> listener.onPlaylistMetadataChanged(eventTime, playlistMetadata));
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 88 with EventTime

use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.

the class DefaultAnalyticsCollector method onAudioUnderrun.

@Override
public final void onAudioUnderrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs) {
    EventTime eventTime = generateReadingMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_AUDIO_UNDERRUN, listener -> listener.onAudioUnderrun(eventTime, bufferSize, bufferSizeMs, elapsedSinceLastFeedMs));
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 89 with EventTime

use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.

the class DefaultAnalyticsCollector method onPlayerError.

@Override
public final void onPlayerError(PlaybackException error) {
    EventTime eventTime = getEventTimeForErrorEvent(error);
    sendEvent(eventTime, AnalyticsListener.EVENT_PLAYER_ERROR, listener -> listener.onPlayerError(eventTime, error));
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 90 with EventTime

use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.

the class DefaultAnalyticsCollector method onAudioDecoderInitialized.

// Calling deprecated listener method.
@SuppressWarnings("deprecation")
@Override
public final void onAudioDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs) {
    EventTime eventTime = generateReadingMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_AUDIO_DECODER_INITIALIZED, listener -> {
        listener.onAudioDecoderInitialized(eventTime, decoderName, initializationDurationMs);
        listener.onAudioDecoderInitialized(eventTime, decoderName, initializedTimestampMs, initializationDurationMs);
        listener.onDecoderInitialized(eventTime, C.TRACK_TYPE_AUDIO, decoderName, initializationDurationMs);
    });
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Aggregations

EventTime (com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)103 Test (org.junit.Test)41 FakeTimeline (com.google.android.exoplayer2.testutil.FakeTimeline)38 Timeline (com.google.android.exoplayer2.Timeline)37 MediaPeriodId (com.google.android.exoplayer2.source.MediaSource.MediaPeriodId)34 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)26 TimelineWindowDefinition (com.google.android.exoplayer2.testutil.FakeTimeline.TimelineWindowDefinition)14 Nullable (androidx.annotation.Nullable)9 AdPlaybackState (com.google.android.exoplayer2.source.ads.AdPlaybackState)6 TestExoPlayerBuilder (com.google.android.exoplayer2.testutil.TestExoPlayerBuilder)6 FakeMediaSource (com.google.android.exoplayer2.testutil.FakeMediaSource)5 InOrder (org.mockito.InOrder)5 AnalyticsListener (com.google.android.exoplayer2.analytics.AnalyticsListener)4 ApplicationProvider (androidx.test.core.app.ApplicationProvider)3 AndroidJUnit4 (androidx.test.ext.junit.runners.AndroidJUnit4)3 ExoPlayer (com.google.android.exoplayer2.ExoPlayer)3 MediaItem (com.google.android.exoplayer2.MediaItem)3 PlaybackException (com.google.android.exoplayer2.PlaybackException)3 PlaybackParameters (com.google.android.exoplayer2.PlaybackParameters)3 Player (com.google.android.exoplayer2.Player)3