Package io.agora.mediaplayer
Interface IMediaPlayerCacheManager
public interface IMediaPlayerCacheManager
-
Method Summary
Modifier and TypeMethodDescriptionintenableAutoRemoveCache(boolean enable) Set whether the player will clean up the cache in the order of resource usage.Get the cache directory.intGet the number of all cache files.intGet the maximum number of cached files.longGet the total size of the largest cache fileintRemove all media resource cache files.intremoveCacheByUri(String uri) Remove the cache file by uri, setting by MediaSource.intRemove the latest media resource cache file.intsetCacheDir(String path) Set cache file path that files will be saved to.intsetMaxCacheFileCount(int count) Set the maximum number of cached files.intsetMaxCacheFileSize(long cacheSize) Set the total size of the largest cache file.
-
Method Details
-
removeAllCaches
int removeAllCaches()Remove all media resource cache files.- Returns:
- - 0: Success. - < 0: Failure.
-
removeOldCache
int removeOldCache()Remove the latest media resource cache file.- Returns:
- - 0: Success. - < 0: Failure.
-
removeCacheByUri
Remove the cache file by uri, setting by MediaSource.- Parameters:
uri- URI,identify the uniqueness of the property, Set from `MeidaSource`- Returns:
- - 0: Success. - < 0: Failure.
-
setCacheDir
Set cache file path that files will be saved to.- Parameters:
path- file path.- Returns:
- - 0: Success. - < 0: Failure.
-
setMaxCacheFileCount
int setMaxCacheFileCount(int count) Set the maximum number of cached files.- Parameters:
count- maximum number of cached files.- Returns:
- - 0: Success. - < 0: Failure.
-
setMaxCacheFileSize
int setMaxCacheFileSize(long cacheSize) Set the total size of the largest cache file.- Parameters:
cacheSize- total size of the largest cache file.- Returns:
- - 0: Success. - < 0: Failure.
-
enableAutoRemoveCache
int enableAutoRemoveCache(boolean enable) Set whether the player will clean up the cache in the order of resource usage.- Parameters:
enable- enable the player to automatically clear the cache.- Returns:
- - 0: Success. - < 0: Failure.
-
getCacheDir
String getCacheDir()Get the cache directory.- Returns:
- - not null: Success. - null: Failure.
-
getMaxCacheFileCount
int getMaxCacheFileCount()Get the maximum number of cached files.- Returns:
- > 0: file count. - < 0: Failure.
-
getMaxCacheFileSize
long getMaxCacheFileSize()Get the total size of the largest cache file- Returns:
- > 0: file size. - < 0: Failure.
-
getCacheFileCount
int getCacheFileCount()Get the number of all cache files.- Returns:
- > 0: file count. - < 0: Failure.
-