Back to Exoplayer

CacheKeyFactory (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/upstream/cache/CacheKeyFactory.html

latest2.6 KB
Original Source

Package com.google.android.exoplayer2.upstream.cache

Interface CacheKeyFactory


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceCacheKeyFactory

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

Factory for cache keys.

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static CacheKeyFactory | DEFAULT | Deprecated.

Default CacheKeyFactory. |

Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | String | buildCacheKey​(DataSpec dataSpec) | Deprecated.

Returns the cache key of the resource containing the data defined by a DataSpec. |

Field Detail

- 

DEFAULT

static final[CacheKeyFactory](CacheKeyFactory.html "interface in com.google.android.exoplayer2.upstream.cache")DEFAULT

Deprecated.

Default CacheKeyFactory.

Method Detail

- 

buildCacheKey

[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")buildCacheKey​([DataSpec](../DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec)

Deprecated.

Returns the cache key of the resource containing the data defined by a DataSpec.

Note that since the returned cache key corresponds to the whole resource, implementations must not return different cache keys for DataSpecs that define different ranges of the same resource. As a result, implementations should not use fields such as DataSpec.position and DataSpec.length.

Parameters:dataSpec - The DataSpec.Returns:The cache key of the resource.