Search in sources :

Example 21 with EventTime

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

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

Example 22 with EventTime

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

the class DefaultAnalyticsCollector method onAvailableCommandsChanged.

@Override
public void onAvailableCommandsChanged(Player.Commands availableCommands) {
    EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_AVAILABLE_COMMANDS_CHANGED, listener -> listener.onAvailableCommandsChanged(eventTime, availableCommands));
}
Also used : EventTime(androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)

Example 23 with EventTime

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

the class DefaultAnalyticsCollector method onIsPlayingChanged.

@Override
public void onIsPlayingChanged(boolean isPlaying) {
    EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_IS_PLAYING_CHANGED, listener -> listener.onIsPlayingChanged(eventTime, isPlaying));
}
Also used : EventTime(androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)

Example 24 with EventTime

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

the class DefaultAnalyticsCollector method onPlaybackStateChanged.

@Override
public final void onPlaybackStateChanged(@Player.State int playbackState) {
    EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_PLAYBACK_STATE_CHANGED, listener -> listener.onPlaybackStateChanged(eventTime, playbackState));
}
Also used : EventTime(androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)

Example 25 with EventTime

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

the class DefaultAnalyticsCollector method onSkipSilenceEnabledChanged.

@Override
public final void onSkipSilenceEnabledChanged(boolean skipSilenceEnabled) {
    EventTime eventTime = generateReadingMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_SKIP_SILENCE_ENABLED_CHANGED, listener -> listener.onSkipSilenceEnabledChanged(eventTime, skipSilenceEnabled));
}
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