同步操作将从 CY./RedPlayer 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
The RedPreload SDK is a powerful tool for preloading videos and improving the user experience. It provides a range of features, including message callbacks, initialization with cache path and maximum size, and more. This guide will walk you through the steps to use the RedPreload SDK.
To set the preload message callback, use the following method:
+ (void)setPreLoadMsgCallback:(RedPreLoadCallback)callback;
To initialize preload with cache path and maximum size, use the following method:
+ (void)initPreLoad:(NSString *)cachePath maxSize:(uint32_t)maxSize;
To initialize preload with cache path, maximum size(byte), and maximum directory capacity, use the following method:
+ (void)initPreLoad:(NSString *)cachePath maxSize:(uint32_t)maxSize maxdircapacity:(int64_t)maxdircapacity;
To open URLs with parameters and user data, use the following method:
/// Struct for RedPreloadParam
typedef struct {
NSString* cachePath; ///< Cache path
int64_t preloadSize; ///< Preload size bytes
NSString* referer; ///< Referer
int dnsTimeout; ///< DNS timeout
bool useHttps; ///< Use HTTPS or not
NSString* userAgent; ///< User agent
NSString* header; ///< Header
int64_t cache_max_dir_capacity; ///< Maximum directory capacity for cache
uint32_t cache_max_entries; ///< Maximum entries for cache
} RedPreloadParam;
+ (void)open:(NSURL *)url param:(RedPreloadParam)param userData:(void* _Nullable)userData;
To open JSON with parameters and user data, use the following method:
+ (void)openJson:(NSString *)jsonStr param:(RedPreloadParam)param userData:(void* _Nullable)userData;
To close URL preload task, use the following method:
+ (void)close:(NSURL *)url;
To close JSON preload task, use the following method:
+ (void)closeJson:(NSString *)jsonStr;
To stop all preload tasks, use the following method:
+ (void)stop;
To get cached size, use the following method:
+ (int64_t)getCachedSize:(NSString *)path uri:(NSString*)uri isFullUrl:(BOOL)isFullUrl;
To get all cached files, use the following method:
+ (NSArray<NSString *> *)getAllCachedFile:(NSString *)path;
To delete cache, use the following method:
+ (int)deleteCache:(NSString *)path uri:(NSString *)uri isFullUrl:(BOOL)isFullUrl;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。