@UnstableApi
public final class PreCacheHelper


A helper for pre-caching a single media.

Summary

Nested types

public final class PreCacheHelper.Factory

A factory for PreCacheHelper.

public interface PreCacheHelper.Listener

A listener for PreCacheHelper events.

Public methods

void
preCache(long startPositionMs, long durationMs)

Pre-caches the underlying media from a startPositionMs and for a durationMs.

void
stop(boolean removeCachedContent)

Stops the pre-caching.

Public methods

preCache

public void preCache(long startPositionMs, long durationMs)

Pre-caches the underlying media from a startPositionMs and for a durationMs.

Can be called from any thread.

Parameters
long startPositionMs

The start position from which the media should be pre-cached, in milliseconds.

long durationMs

The duration for which the media should be pre-cached, in milliseconds.

stop

public void stop(boolean removeCachedContent)

Stops the pre-caching.

Can be called from any thread.

Parameters
boolean removeCachedContent

Whether the cached content should be removed.