DefaultPreloadManager.PreloadStatus


public final class DefaultPreloadManager.PreloadStatus


Defines the preload status for the DefaultPreloadManager.

Summary

Nested types

Stages for the preload status.

Constants

static final DefaultPreloadManager.PreloadStatus

A PreloadStatus indicating that the media item should not be preloaded.

static final DefaultPreloadManager.PreloadStatus

A PreloadStatus indicating that the source has completed preparation.

static final DefaultPreloadManager.PreloadStatus

A PreloadStatus indicating that the source has tracks selected.

static final int
STAGE_NOT_PRELOADED = -2147483648

The media item has not preloaded yet.

static final int

The PreloadMediaSource has completed preparation.

static final int

The media item has been cached for a specific range defined by startPositionMs and durationMs.

static final int

The PreloadMediaSource has been loaded for a specific range defined by startPositionMs and durationMs.

static final int

The PreloadMediaSource has tracks selected.

Public fields

final long

The duration in milliseconds for which the source should be loaded from the startPositionMs, or TIME_UNSET to indicate that the source should be loaded to end of source.

final int

The stage for the preload status.

final long

The start position in milliseconds from which the source should be loaded, or TIME_UNSET to indicate the default start position.

Public methods

boolean
int
static DefaultPreloadManager.PreloadStatus
specifiedRangeCached(long durationMs)

Returns a PreloadStatus indicating to cache the media item from the default start position and for the specified duration (in milliseconds).

static DefaultPreloadManager.PreloadStatus
specifiedRangeCached(long startPositionMs, long durationMs)

Returns a PreloadStatus indicating to cache the media item from the specified start position (in milliseconds) and for the specified duration (in milliseconds).

static DefaultPreloadManager.PreloadStatus
specifiedRangeLoaded(long durationMs)

Returns a PreloadStatus indicating to load the source from the default start position and for the specified duration (in milliseconds).

static DefaultPreloadManager.PreloadStatus
specifiedRangeLoaded(long startPositionMs, long durationMs)

Returns a PreloadStatus indicating to load the source from the specified start position (in milliseconds) and for the specified duration (in milliseconds).

Constants

PRELOAD_STATUS_NOT_PRELOADED

public static final DefaultPreloadManager.PreloadStatus PRELOAD_STATUS_NOT_PRELOADED

A PreloadStatus indicating that the media item should not be preloaded.

PRELOAD_STATUS_SOURCE_PREPARED

public static final DefaultPreloadManager.PreloadStatus PRELOAD_STATUS_SOURCE_PREPARED

A PreloadStatus indicating that the source has completed preparation.

PRELOAD_STATUS_TRACKS_SELECTED

public static final DefaultPreloadManager.PreloadStatus PRELOAD_STATUS_TRACKS_SELECTED

A PreloadStatus indicating that the source has tracks selected.

STAGE_NOT_PRELOADED

public static final int STAGE_NOT_PRELOADED = -2147483648

The media item has not preloaded yet.

STAGE_SOURCE_PREPARED

public static final int STAGE_SOURCE_PREPARED = 0

The PreloadMediaSource has completed preparation.

STAGE_SPECIFIED_RANGE_CACHED

public static final int STAGE_SPECIFIED_RANGE_CACHED = -1

The media item has been cached for a specific range defined by startPositionMs and durationMs.

STAGE_SPECIFIED_RANGE_LOADED

public static final int STAGE_SPECIFIED_RANGE_LOADED = 2

The PreloadMediaSource has been loaded for a specific range defined by startPositionMs and durationMs.

STAGE_TRACKS_SELECTED

public static final int STAGE_TRACKS_SELECTED = 1

The PreloadMediaSource has tracks selected.

Public fields

durationMs

public final long durationMs

The duration in milliseconds for which the source should be loaded from the startPositionMs, or TIME_UNSET to indicate that the source should be loaded to end of source.

stage

@DefaultPreloadManager.PreloadStatus.Stage
public final int stage

The stage for the preload status.

startPositionMs

public final long startPositionMs

The start position in milliseconds from which the source should be loaded, or TIME_UNSET to indicate the default start position.

Public methods

equals

public boolean equals(@Nullable Object obj)

hashCode

public int hashCode()

specifiedRangeCached

public static DefaultPreloadManager.PreloadStatus specifiedRangeCached(long durationMs)

Returns a PreloadStatus indicating to cache the media item from the default start position and for the specified duration (in milliseconds).

specifiedRangeCached

public static DefaultPreloadManager.PreloadStatus specifiedRangeCached(long startPositionMs, long durationMs)

Returns a PreloadStatus indicating to cache the media item from the specified start position (in milliseconds) and for the specified duration (in milliseconds).

specifiedRangeLoaded

public static DefaultPreloadManager.PreloadStatus specifiedRangeLoaded(long durationMs)

Returns a PreloadStatus indicating to load the source from the default start position and for the specified duration (in milliseconds).

specifiedRangeLoaded

public static DefaultPreloadManager.PreloadStatus specifiedRangeLoaded(long startPositionMs, long durationMs)

Returns a PreloadStatus indicating to load the source from the specified start position (in milliseconds) and for the specified duration (in milliseconds).