|
Agora RTC Objective-C API Reference
Refactor
|
Inherits <NSObject>.
Instance Methods | |
| (int) | - removeAllCaches |
| (int) | - removeOldCache |
| (int) | - removeCacheByUri: |
| (int) | - setCacheDir: |
| (int) | - setMaxCacheFileCount: |
| (int) | - setMaxCacheFileSize: |
| (int) | - enableAutoRemoveCache: |
| (NSString *) | - cacheDir |
| (NSInteger) | - maxCacheFileCount |
| (NSInteger) | - maxCacheFileSize |
| (NSInteger) | - cacheFileCount |
Class Methods | |
| (instancetype) | + sharedInstance |
| + (instancetype) sharedInstance |
Gets a AgoraRtcMediaPlayerCacheManagerProtocol instance.
AgoraRtcMediaPlayerCacheManagerProtocol instance. | - (int) removeAllCaches |
Deletes all cached media files in the media player.
AgoraMediaPlayerReason. | - (int) removeOldCache |
Deletes a cached media file that is the least recently used.
You can call this method to delete a cached media file when the storage space for the cached files is about to reach its limit. After you call this method, the SDK deletes the cached media file that is least used.
AgoraMediaPlayerReason. | - (int) removeCacheByUri: | (NSString *) | uri |
Deletes a cached media file.
| uri | The URI (Uniform Resource Identifier) of the media file to be deleted. |
AgoraMediaPlayerReason. | - (int) setCacheDir: | (NSString *) | cacheDir |
Sets the storage path for the media files that you want to cache.
AgoraRtcEngineKit is initialized before you call this method.| cacheDir | The absolute path of the media files to be cached. Ensure that the directory for the media files exists and is writable. |
AgoraMediaPlayerReason. | - (int) setMaxCacheFileCount: | (NSInteger) | count |
Sets the maximum number of media files that can be cached.
| count | The maximum number of media files that can be cached. The default value is 1,000. |
AgoraMediaPlayerReason. | - (int) setMaxCacheFileSize: | (NSInteger) | cacheSize |
Sets the maximum size of the aggregate storage space for cached media files.
| cacheSize | The maximum size (bytes) of the aggregate storage space for cached media files. The default value is 1 GB. |
AgoraMediaPlayerReason. | - (int) enableAutoRemoveCache: | (BOOL) | enable |
Sets whether to delete cached media files automatically.
If you enable this function to remove cached media files automatically, when the cached media files exceed either the number or size limit you set, the SDK automatically deletes the least recently used cache file.
| enable | Whether to enable the SDK to delete cached media files automatically:
|
AgoraMediaPlayerReason. | - (NSString *) cacheDir |
Gets the storage path of the cached media files.
If you have not called the setCacheDir: method to set the storage path for the media files to be cached before calling this method, you get the default storage path used by the SDK.
AgoraMediaPlayerReason. | - (NSInteger) maxCacheFileCount |
Gets the maximum number of media files that can be cached.
By default, the maximum number of media files that can be cached is 1,000.
AgoraMediaPlayerReason. | - (NSInteger) maxCacheFileSize |
Gets the maximum size of the aggregate storage space for cached media files.
By default, the maximum size of the aggregate storage space for cached media files is 1 GB. You can call the setMaxCacheFileSize: method to set the limit according to your scenarios.
AgoraMediaPlayerReason. | - (NSInteger) cacheFileCount |
Gets the number of media files that are cached.
AgoraMediaPlayerReason.