Search in sources :

Example 26 with Listener

use of com.google.android.exoplayer2.Player.Listener in project ExoPlayer by google.

the class DefaultAnalyticsCollector method onDrmKeysRemoved.

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

Example 27 with Listener

use of com.google.android.exoplayer2.Player.Listener in project ExoPlayer by google.

the class DefaultAnalyticsCollector method onMediaMetadataChanged.

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

Example 28 with Listener

use of com.google.android.exoplayer2.Player.Listener in project ExoPlayer by google.

the class DefaultAnalyticsCollector method onSeekProcessed.

// Implementing and calling deprecated listener method.
@SuppressWarnings("deprecation")
@Override
public final void onSeekProcessed() {
    EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
    sendEvent(eventTime, /* eventFlag= */
    C.INDEX_UNSET, listener -> listener.onSeekProcessed(eventTime));
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 29 with Listener

use of com.google.android.exoplayer2.Player.Listener in project ExoPlayer by google.

the class DefaultAnalyticsCollector method onAudioCodecError.

@Override
public final void onAudioCodecError(Exception audioCodecError) {
    EventTime eventTime = generateReadingMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_AUDIO_CODEC_ERROR, listener -> listener.onAudioCodecError(eventTime, audioCodecError));
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 30 with Listener

use of com.google.android.exoplayer2.Player.Listener in project ExoPlayer by google.

the class DefaultAnalyticsCollector method onVideoDisabled.

@Override
// Calling deprecated listener method.
@SuppressWarnings("deprecation")
public final void onVideoDisabled(DecoderCounters counters) {
    EventTime eventTime = generatePlayingMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_VIDEO_DISABLED, listener -> {
        listener.onVideoDisabled(eventTime, counters);
        listener.onDecoderDisabled(eventTime, C.TRACK_TYPE_VIDEO, counters);
    });
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Aggregations

Test (org.junit.Test)87 EventTime (com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)68 FakeMediaSource (com.google.android.exoplayer2.testutil.FakeMediaSource)58 TestExoPlayerBuilder (com.google.android.exoplayer2.testutil.TestExoPlayerBuilder)54 Listener (com.google.android.exoplayer2.Player.Listener)45 ConcatenatingMediaSource (com.google.android.exoplayer2.source.ConcatenatingMediaSource)38 MediaSource (com.google.android.exoplayer2.source.MediaSource)38 FakeTimeline (com.google.android.exoplayer2.testutil.FakeTimeline)34 ArrayList (java.util.ArrayList)33 AnalyticsListener (com.google.android.exoplayer2.analytics.AnalyticsListener)31 Nullable (androidx.annotation.Nullable)27 ActionSchedule (com.google.android.exoplayer2.testutil.ActionSchedule)27 TimelineWindowDefinition (com.google.android.exoplayer2.testutil.FakeTimeline.TimelineWindowDefinition)26 TransferListener (com.google.android.exoplayer2.upstream.TransferListener)26 PositionInfo (com.google.android.exoplayer2.Player.PositionInfo)25 DrmSessionEventListener (com.google.android.exoplayer2.drm.DrmSessionEventListener)25 MediaSourceEventListener (com.google.android.exoplayer2.source.MediaSourceEventListener)25 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)24 InOrder (org.mockito.InOrder)22 AndroidJUnit4 (androidx.test.ext.junit.runners.AndroidJUnit4)21