use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.
the class DefaultPlaybackSessionManager method updateSessionsWithTimelineChange.
@Override
public synchronized void updateSessionsWithTimelineChange(EventTime eventTime) {
Assertions.checkNotNull(listener);
Timeline previousTimeline = currentTimeline;
currentTimeline = eventTime.timeline;
Iterator<SessionDescriptor> iterator = sessions.values().iterator();
while (iterator.hasNext()) {
SessionDescriptor session = iterator.next();
if (!session.tryResolvingToNewTimeline(previousTimeline, currentTimeline) || session.isFinishedAtEventTime(eventTime)) {
iterator.remove();
if (session.isCreated) {
if (session.sessionId.equals(currentSessionId)) {
currentSessionId = null;
}
listener.onSessionFinished(eventTime, session.sessionId, /* automaticTransitionToNextPlayback= */
false);
}
}
}
updateCurrentSession(eventTime);
}
use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.
the class DefaultAnalyticsCollector method onMediaItemTransition.
@Override
public final void onMediaItemTransition(@Nullable MediaItem mediaItem, @Player.MediaItemTransitionReason int reason) {
EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(eventTime, AnalyticsListener.EVENT_MEDIA_ITEM_TRANSITION, listener -> listener.onMediaItemTransition(eventTime, mediaItem, reason));
}
use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.
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));
}
use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.
the class DefaultAnalyticsCollector method onLoadStarted.
// MediaSourceEventListener implementation.
@Override
public final void onLoadStarted(int windowIndex, @Nullable MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) {
EventTime eventTime = generateMediaPeriodEventTime(windowIndex, mediaPeriodId);
sendEvent(eventTime, AnalyticsListener.EVENT_LOAD_STARTED, listener -> listener.onLoadStarted(eventTime, loadEventInfo, mediaLoadData));
}
use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.
the class DefaultAnalyticsCollector method onSeekForwardIncrementChanged.
@Override
public void onSeekForwardIncrementChanged(long seekForwardIncrementMs) {
EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(eventTime, AnalyticsListener.EVENT_SEEK_FORWARD_INCREMENT_CHANGED, listener -> listener.onSeekForwardIncrementChanged(eventTime, seekForwardIncrementMs));
}
Aggregations