Search in sources :

Example 16 with EventTime

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

the class DefaultAnalyticsCollector method notifySeekStarted.

// External events.
@Override
// Calling deprecated listener method.
@SuppressWarnings("deprecation")
public final void notifySeekStarted() {
    if (!isSeeking) {
        EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
        isSeeking = true;
        sendEvent(eventTime, /* eventFlag= */
        C.INDEX_UNSET, listener -> listener.onSeekStarted(eventTime));
    }
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 17 with EventTime

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

the class DefaultAnalyticsCollector method onRepeatModeChanged.

@Override
public final void onRepeatModeChanged(@Player.RepeatMode int repeatMode) {
    EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_REPEAT_MODE_CHANGED, listener -> listener.onRepeatModeChanged(eventTime, repeatMode));
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 18 with EventTime

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

the class DefaultAnalyticsCollector method onDrmSessionReleased.

@Override
public final void onDrmSessionReleased(int windowIndex, @Nullable MediaPeriodId mediaPeriodId) {
    EventTime eventTime = generateMediaPeriodEventTime(windowIndex, mediaPeriodId);
    sendEvent(eventTime, AnalyticsListener.EVENT_DRM_SESSION_RELEASED, listener -> listener.onDrmSessionReleased(eventTime));
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 19 with EventTime

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

the class DefaultAnalyticsCollector method onLoadCanceled.

@Override
public final void onLoadCanceled(int windowIndex, @Nullable MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) {
    EventTime eventTime = generateMediaPeriodEventTime(windowIndex, mediaPeriodId);
    sendEvent(eventTime, AnalyticsListener.EVENT_LOAD_CANCELED, listener -> listener.onLoadCanceled(eventTime, loadEventInfo, mediaLoadData));
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 20 with EventTime

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

the class DefaultAnalyticsCollector method onPlaybackSuppressionReasonChanged.

@Override
public final void onPlaybackSuppressionReasonChanged(@PlaybackSuppressionReason int playbackSuppressionReason) {
    EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_PLAYBACK_SUPPRESSION_REASON_CHANGED, listener -> listener.onPlaybackSuppressionReasonChanged(eventTime, playbackSuppressionReason));
}
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