# AnalyticsListener.EventTime

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/analytics/AnalyticsListener.java+class:androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)

*** ** * ** ***


```
@UnstableApi
public final class AnalyticsListener.EventTime
```

<br />

*** ** * ** ***

Time information of an event.

## Summary

| ### Public fields |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` | `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#currentMediaPeriodId()` `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` for the currently playing media period at the time of the event, or `null` if no current media period identifier is available. |
| `final long` | `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#currentPlaybackPositionMs()` Position in the `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#currentWindowIndex()` or the currently playing ad at the time of the event, in milliseconds. |
| `final https://developer.android.com/reference/androidx/media3/common/Timeline` | `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#currentTimeline()` The current `https://developer.android.com/reference/androidx/media3/common/Timeline` at the time of the event (equivalent to `https://developer.android.com/reference/androidx/media3/common/Player#getCurrentTimeline()`). |
| `final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#currentWindowIndex()` The current window index in `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#currentTimeline()` at the time of the event, or the prospective window index if the timeline is not yet known and empty (equivalent to `https://developer.android.com/reference/androidx/media3/common/Player#getCurrentMediaItemIndex()`). |
| `final long` | `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#eventPlaybackPositionMs()` Position in the window or ad this event belongs to at the time of the event, in milliseconds. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` | `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#mediaPeriodId()` `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` for the media period this event belongs to, or `null` if the event is not associated with a specific media period. |
| `final long` | `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#realtimeMs()` Elapsed real-time as returned by `SystemClock.elapsedRealtime()` at the time of the event, in milliseconds. |
| `final https://developer.android.com/reference/androidx/media3/common/Timeline` | `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#timeline()` Most recent `https://developer.android.com/reference/androidx/media3/common/Timeline` that contains the event position. |
| `final long` | `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#totalBufferedDurationMs()` Total buffered duration from `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#currentPlaybackPositionMs()` at the time of the event, in milliseconds. |
| `final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#windowIndex()` Window index in the `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#timeline()` this event belongs to, or the prospective window index if the timeline is not yet known and empty. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#EventTime(long,androidx.media3.common.Timeline,int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,long,androidx.media3.common.Timeline,int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,long,long)( long realtimeMs, https://developer.android.com/reference/androidx/media3/common/Timeline timeline, int windowIndex, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId, long eventPlaybackPositionMs, https://developer.android.com/reference/androidx/media3/common/Timeline currentTimeline, int currentWindowIndex, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId currentMediaPeriodId, long currentPlaybackPositionMs, long totalBufferedDurationMs )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html o)` |
| `int` | `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#hashCode()()` |

## Public fields

### currentMediaPeriodId

```
public final @Nullable MediaSource.MediaPeriodId currentMediaPeriodId
```

`https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` 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 `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#currentWindowIndex()` or the currently playing ad at the time of the event, in milliseconds.

### currentTimeline

```
public final Timeline currentTimeline
```

The current `https://developer.android.com/reference/androidx/media3/common/Timeline` at the time of the event (equivalent to `https://developer.android.com/reference/androidx/media3/common/Player#getCurrentTimeline()`).

### currentWindowIndex

```
public final int currentWindowIndex
```

The current window index in `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#currentTimeline()` at the time of the event, or the prospective window index if the timeline is not yet known and empty (equivalent to `https://developer.android.com/reference/androidx/media3/common/Player#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
```

`https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` 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 `https://developer.android.com/reference/androidx/media3/common/Timeline` that contains the event position.

### totalBufferedDurationMs

```
public final long totalBufferedDurationMs
```

Total buffered duration from `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#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 `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime#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. |
| `https://developer.android.com/reference/androidx/media3/common/Timeline timeline` | Most recent `https://developer.android.com/reference/androidx/media3/common/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. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId` | `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` 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. |
| `https://developer.android.com/reference/androidx/media3/common/Timeline currentTimeline` | The current `https://developer.android.com/reference/androidx/media3/common/Timeline` at the time of the event (equivalent to `https://developer.android.com/reference/androidx/media3/common/Player#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 `https://developer.android.com/reference/androidx/media3/common/Player#getCurrentMediaItemIndex()`). |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId currentMediaPeriodId` | `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` 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()
```