@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
release(boolean removeCachedContent)

Releases the PreCacheHelper.

void

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.

release

public void release(boolean removeCachedContent)

Releases the PreCacheHelper.

Can be called from any thread.

Parameters
boolean removeCachedContent

Whether the cached content should be removed. If true, the PreCacheHelper will create a new thread to remove the cached content.

stop

public void stop()

Stops the pre-caching.

Can be called from any thread.