AnalyticsListener.EventTime


@UnstableApi
public final class AnalyticsListener.EventTime


Time information of an event.

Summary

Public fields

final @Nullable MediaSource.MediaPeriodId

Media period identifier for the currently playing media period at the time of the event, or null if no current media period identifier is available.

final long

Position in the current timeline window or the currently playing ad at the time of the event, in milliseconds.

final Timeline

The current Timeline at the time of the event (equivalent to getCurrentTimeline).

final int

The current window index in currentTimeline at the time of the event, or the prospective window index if the timeline is not yet known and empty (equivalent to getCurrentMediaItemIndex).

final long

Position in the window or ad this event belongs to at the time of the event, in milliseconds.

final @Nullable MediaSource.MediaPeriodId

Media period identifier for the media period this event belongs to, or null if the event is not associated with a specific media period.

final long

Elapsed real-time as returned by SystemClock.elapsedRealtime() at the time of the event, in milliseconds.

final Timeline

Most recent Timeline that contains the event position.

final long

Total buffered duration from currentPlaybackPositionMs at the time of the event, in milliseconds.

final int

Window index in the timeline this event belongs to, or the prospective window index if the timeline is not yet known and empty.

Public constructors

EventTime(
    long realtimeMs,
    Timeline timeline,
    int windowIndex,
    @Nullable MediaSource.MediaPeriodId mediaPeriodId,
    long eventPlaybackPositionMs,
    Timeline currentTimeline,
    int currentWindowIndex,
    @Nullable MediaSource.MediaPeriodId currentMediaPeriodId,
    long currentPlaybackPositionMs,
    long totalBufferedDurationMs
)

Public methods

boolean
int

Public fields

currentMediaPeriodId

public final @Nullable MediaSource.MediaPeriodId currentMediaPeriodId

Media period identifier for the currently playing media period at the time of the event, or null if no current media period identifier is available.

currentPlaybackPositionMs

public final long currentPlaybackPositionMs

Position in the current timeline window or the currently playing ad at the time of the event, in milliseconds.

currentTimeline

public final Timeline currentTimeline

The current Timeline at the time of the event (equivalent to getCurrentTimeline).

currentWindowIndex

public final int currentWindowIndex

The current window index in currentTimeline at the time of the event, or the prospective window index if the timeline is not yet known and empty (equivalent to getCurrentMediaItemIndex).

eventPlaybackPositionMs

public final long eventPlaybackPositionMs

Position in the window or ad this event belongs to at the time of the event, in milliseconds.

mediaPeriodId

public final @Nullable MediaSource.MediaPeriodId mediaPeriodId

Media period identifier for the media period this event belongs to, or null if the event is not associated with a specific media period.

realtimeMs

public final long realtimeMs

Elapsed real-time as returned by SystemClock.elapsedRealtime() at the time of the event, in milliseconds.

timeline

public final Timeline timeline

Most recent Timeline that contains the event position.

totalBufferedDurationMs

public final long totalBufferedDurationMs

Total buffered duration from currentPlaybackPositionMs at the time of the event, in milliseconds. This includes pre-buffered data for subsequent ads and windows.

windowIndex

public final int windowIndex

Window index in the timeline this event belongs to, or the prospective window index if the timeline is not yet known and empty.

Public constructors

EventTime

public EventTime(
    long realtimeMs,
    Timeline timeline,
    int windowIndex,
    @Nullable MediaSource.MediaPeriodId mediaPeriodId,
    long eventPlaybackPositionMs,
    Timeline currentTimeline,
    int currentWindowIndex,
    @Nullable MediaSource.MediaPeriodId currentMediaPeriodId,
    long currentPlaybackPositionMs,
    long totalBufferedDurationMs
)
Parameters
long realtimeMs

Elapsed real-time as returned by SystemClock.elapsedRealtime() at the time of the event, in milliseconds.

Timeline timeline

Most recent Timeline that contains the event position.

int windowIndex

Window index in the timeline this event belongs to, or the prospective window index if the timeline is not yet known and empty.

@Nullable MediaSource.MediaPeriodId mediaPeriodId

Media period identifier for the media period this event belongs to, or null if the event is not associated with a specific media period.

long eventPlaybackPositionMs

Position in the window or ad this event belongs to at the time of the event, in milliseconds.

Timeline currentTimeline

The current Timeline at the time of the event (equivalent to getCurrentTimeline).

int currentWindowIndex

The current window index in currentTimeline at the time of the event, or the prospective window index if the timeline is not yet known and empty (equivalent to getCurrentMediaItemIndex).

@Nullable MediaSource.MediaPeriodId currentMediaPeriodId

Media period identifier for the currently playing media period at the time of the event, or null if no current media period identifier is available.

long currentPlaybackPositionMs

Position in the current timeline window or the currently playing ad at the time of the event, in milliseconds.

long totalBufferedDurationMs

Total buffered duration from currentPlaybackPositionMs at the time of the event, in milliseconds. This includes pre-buffered data for subsequent ads and windows.

Public methods

equals

public boolean equals(@Nullable Object o)

hashCode

public int hashCode()