use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.
the class MediaMetricsListener method onVideoSizeChanged.
@Override
public void onVideoSizeChanged(EventTime eventTime, VideoSize videoSize) {
@Nullable PendingFormatUpdate pendingVideoFormat = this.pendingVideoFormat;
if (pendingVideoFormat != null && pendingVideoFormat.format.height == Format.NO_VALUE) {
Format formatWithHeightAndWidth = pendingVideoFormat.format.buildUpon().setWidth(videoSize.width).setHeight(videoSize.height).build();
this.pendingVideoFormat = new PendingFormatUpdate(formatWithHeightAndWidth, pendingVideoFormat.selectionReason, pendingVideoFormat.sessionId);
}
}
use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.
the class DefaultAnalyticsCollector method onVideoDecoderInitialized.
@Override
// Calling deprecated listener method.
@SuppressWarnings("deprecation")
public final void onVideoDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs) {
EventTime eventTime = generateReadingMediaPeriodEventTime();
sendEvent(eventTime, AnalyticsListener.EVENT_VIDEO_DECODER_INITIALIZED, listener -> {
listener.onVideoDecoderInitialized(eventTime, decoderName, initializationDurationMs);
listener.onVideoDecoderInitialized(eventTime, decoderName, initializedTimestampMs, initializationDurationMs);
listener.onDecoderInitialized(eventTime, C.TRACK_TYPE_VIDEO, decoderName, initializationDurationMs);
});
}
use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.
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));
}
use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.
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));
}
use of com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime in project ExoPlayer by google.
the class DefaultAnalyticsCollector method generateMediaPeriodEventTime.
private EventTime generateMediaPeriodEventTime(int windowIndex, @Nullable MediaPeriodId mediaPeriodId) {
checkNotNull(player);
if (mediaPeriodId != null) {
boolean isInKnownTimeline = mediaPeriodQueueTracker.getMediaPeriodIdTimeline(mediaPeriodId) != null;
return isInKnownTimeline ? generateEventTime(mediaPeriodId) : generateEventTime(Timeline.EMPTY, windowIndex, mediaPeriodId);
}
Timeline timeline = player.getCurrentTimeline();
boolean windowIsInTimeline = windowIndex < timeline.getWindowCount();
return generateEventTime(windowIsInTimeline ? timeline : Timeline.EMPTY, windowIndex, /* mediaPeriodId= */
null);
}
Aggregations