setGlobalCacheFolderPath static method
Local caching of video files is a highly demanded feature in short video playback scenarios. For ordinary users, when watching a video that has already been viewed, it should not consume data traffic again. @Format support: The SDK supports caching for two common VOD formats: HLS(m3u8) and MP4. @Timing of enabling: The SDK does not enable caching by default, and it is not recommended to enable this feature for scenarios with low user review rates. @Method of enabling: Global effect, enabled with the player. To enable this feature, two parameters need to be configured: the local cache directory and the cache size.
The cache path is set by default to the app sandbox directory, and postfixPath only needs to pass the relative cache directory, without passing the entire absolute path. e.g. postfixPath = 'testCache' On Android platform: the video will be cached to the sdcard/Android/data/your-pkg-name/files/testCache directory. On iOS platform: the video will be cached to the Documents/testCache directory in the sandbox. @param postfixPath Cache directory @return true if the setting is successful, false if the setting fails.
Implementation
static Future<bool?> setGlobalCacheFolderPath(String postfixPath) async {
return await _pluginChannel.invoke<bool>('setGlobalCacheFolderPath', {
'value': postfixPath,
});
}