Search in sources :

Example 6 with EventTime

use of androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime in project media by androidx.

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(androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)

Example 7 with EventTime

use of androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime in project media by androidx.

the class DefaultAnalyticsCollector method onSurfaceSizeChanged.

@Override
public final void onSurfaceSizeChanged(int width, int height) {
    EventTime eventTime = generateReadingMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_SURFACE_SIZE_CHANGED, listener -> listener.onSurfaceSizeChanged(eventTime, width, height));
}
Also used : EventTime(androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)

Example 8 with EventTime

use of androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime in project media by androidx.

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(androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)

Example 9 with EventTime

use of androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime in project media by androidx.

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(androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)

Example 10 with EventTime

use of androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime in project media by androidx.

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(androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)

Aggregations

EventTime (androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)103 Test (org.junit.Test)41 Timeline (androidx.media3.common.Timeline)39 FakeTimeline (androidx.media3.test.utils.FakeTimeline)38 MediaPeriodId (androidx.media3.exoplayer.source.MediaSource.MediaPeriodId)34 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)26 TimelineWindowDefinition (androidx.media3.test.utils.FakeTimeline.TimelineWindowDefinition)14 Nullable (androidx.annotation.Nullable)9 AdPlaybackState (androidx.media3.common.AdPlaybackState)6 TestExoPlayerBuilder (androidx.media3.test.utils.TestExoPlayerBuilder)6 FakeMediaSource (androidx.media3.test.utils.FakeMediaSource)5 PlaybackException (androidx.media3.common.PlaybackException)4 InOrder (org.mockito.InOrder)4 MediaItem (androidx.media3.common.MediaItem)3 PlaybackParameters (androidx.media3.common.PlaybackParameters)3 Player (androidx.media3.common.Player)3 ActionSchedule (androidx.media3.test.utils.ActionSchedule)3 ExoPlayerTestRunner (androidx.media3.test.utils.ExoPlayerTestRunner)3 IOException (java.io.IOException)3 Format (androidx.media3.common.Format)2