Search in sources :

Example 96 with EventTime

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

the class DefaultAnalyticsCollector method onSeekBackIncrementChanged.

@Override
public void onSeekBackIncrementChanged(long seekBackIncrementMs) {
    EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_SEEK_BACK_INCREMENT_CHANGED, listener -> listener.onSeekBackIncrementChanged(eventTime, seekBackIncrementMs));
}
Also used : EventTime(androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)

Example 97 with EventTime

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

the class DefaultAnalyticsCollector method onCues.

@Override
public void onCues(List<Cue> cues) {
    EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_CUES, listener -> listener.onCues(eventTime, cues));
}
Also used : EventTime(androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)

Example 98 with EventTime

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

the class DefaultAnalyticsCollector method onAudioSessionIdChanged.

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

Example 99 with EventTime

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

the class DefaultAnalyticsCollector method onMetadata.

@Override
public final void onMetadata(Metadata metadata) {
    EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_METADATA, listener -> listener.onMetadata(eventTime, metadata));
}
Also used : EventTime(androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)

Example 100 with EventTime

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

the class DefaultAnalyticsCollector method onPlayerStateChanged.

// Implementing and calling deprecated listener method.
@SuppressWarnings("deprecation")
@Override
public final void onPlayerStateChanged(boolean playWhenReady, @Player.State int playbackState) {
    EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
    sendEvent(eventTime, /* eventFlag= */
    C.INDEX_UNSET, listener -> listener.onPlayerStateChanged(eventTime, playWhenReady, playbackState));
}
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