@UnstableApi
class PreCacheHelper


A helper for pre-caching a single media.

Summary

Nested types

A factory for PreCacheHelper.

A listener for PreCacheHelper events.

Public functions

Unit
preCache(startPositionMs: Long, durationMs: Long)

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

Unit
stop(removeCachedContent: Boolean)

Stops the pre-caching.

Public functions

preCache

fun preCache(startPositionMs: Long, durationMs: Long): Unit

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

Can be called from any thread.

Parameters
startPositionMs: Long

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

durationMs: Long

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

stop

fun stop(removeCachedContent: Boolean): Unit

Stops the pre-caching.

Can be called from any thread.

Parameters
removeCachedContent: Boolean

Whether the cached content should be removed.