Search in sources :

Example 71 with EventTime

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

the class DefaultAnalyticsCollector method onRenderedFirstFrame.

@Override
public final void onRenderedFirstFrame(Object output, long renderTimeMs) {
    EventTime eventTime = generateReadingMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_RENDERED_FIRST_FRAME, listener -> listener.onRenderedFirstFrame(eventTime, output, renderTimeMs));
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 72 with EventTime

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

the class DefaultAnalyticsCollector method onVideoInputFormatChanged.

@Override
// Calling deprecated listener method.
@SuppressWarnings("deprecation")
public final void onVideoInputFormatChanged(Format format, @Nullable DecoderReuseEvaluation decoderReuseEvaluation) {
    EventTime eventTime = generateReadingMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_VIDEO_INPUT_FORMAT_CHANGED, listener -> {
        listener.onVideoInputFormatChanged(eventTime, format);
        listener.onVideoInputFormatChanged(eventTime, format, decoderReuseEvaluation);
        listener.onDecoderInputFormatChanged(eventTime, C.TRACK_TYPE_VIDEO, format);
    });
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 73 with EventTime

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

the class DefaultAnalyticsCollector method onDrmKeysLoaded.

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

Example 74 with EventTime

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

the class DefaultAnalyticsCollector method onBandwidthSample.

// BandwidthMeter.EventListener implementation.
@Override
public final void onBandwidthSample(int elapsedMs, long bytesTransferred, long bitrateEstimate) {
    EventTime eventTime = generateLoadingMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_BANDWIDTH_ESTIMATE, listener -> listener.onBandwidthEstimate(eventTime, elapsedMs, bytesTransferred, bitrateEstimate));
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 75 with EventTime

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

the class DefaultAnalyticsCollector method onShuffleModeEnabledChanged.

@Override
public final void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
    EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_SHUFFLE_MODE_ENABLED_CHANGED, listener -> listener.onShuffleModeChanged(eventTime, shuffleModeEnabled));
}
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