@UnstableApi
public final class LoadEventInfo


MediaSource load event information.

Summary

Public fields

final long

The number of bytes that were loaded up to the event time.

final DataSpec

Defines the requested data.

final long

The value of elapsedRealtime at the time of the load event.

final long

The duration of the load up to the event time.

final long

Identifies the load task to which this event corresponds.

final Map<StringList<String>>

The response headers associated with the load, or an empty map if unavailable.

final Uri

The Uri from which data is being read.

Public constructors

LoadEventInfo(
    long loadTaskId,
    DataSpec dataSpec,
    long elapsedRealtimeMs
)

Equivalent to LoadEventInfo(loadTaskId, dataSpec, dataSpec.uri, Collections.emptyMap(), elapsedRealtimeMs, 0, 0).

LoadEventInfo(
    long loadTaskId,
    DataSpec dataSpec,
    Uri uri,
    Map<StringList<String>> responseHeaders,
    long elapsedRealtimeMs,
    long loadDurationMs,
    long bytesLoaded
)

Creates load event info.

Public methods

static long

Returns an non-negative identifier which is unique to the JVM instance.

Public fields

bytesLoaded

public final long bytesLoaded

The number of bytes that were loaded up to the event time.

dataSpec

public final DataSpec dataSpec

Defines the requested data.

elapsedRealtimeMs

public final long elapsedRealtimeMs

The value of elapsedRealtime at the time of the load event.

loadDurationMs

public final long loadDurationMs

The duration of the load up to the event time.

loadTaskId

public final long loadTaskId

Identifies the load task to which this event corresponds.

responseHeaders

public final Map<StringList<String>> responseHeaders

The response headers associated with the load, or an empty map if unavailable.

uri

public final Uri uri

The Uri from which data is being read. The uri will be identical to the one in dataSpec.uri unless redirection has occurred. If redirection has occurred, this is the uri after redirection.

Public constructors

LoadEventInfo

public LoadEventInfo(
    long loadTaskId,
    DataSpec dataSpec,
    long elapsedRealtimeMs
)

Equivalent to LoadEventInfo(loadTaskId, dataSpec, dataSpec.uri, Collections.emptyMap(), elapsedRealtimeMs, 0, 0).

LoadEventInfo

public LoadEventInfo(
    long loadTaskId,
    DataSpec dataSpec,
    Uri uri,
    Map<StringList<String>> responseHeaders,
    long elapsedRealtimeMs,
    long loadDurationMs,
    long bytesLoaded
)

Creates load event info.

Parameters
long loadTaskId

See loadTaskId.

DataSpec dataSpec

See dataSpec.

Uri uri

See uri.

Map<StringList<String>> responseHeaders

See responseHeaders.

long elapsedRealtimeMs

See elapsedRealtimeMs.

long loadDurationMs

See loadDurationMs.

long bytesLoaded

See bytesLoaded.

Public methods

getNewId

public static long getNewId()

Returns an non-negative identifier which is unique to the JVM instance.