-
public class CacheHelper
-
-
Field Summary
Fields Modifier and Type Field Description private static DownloadManagerdownloadManager
-
Constructor Summary
Constructors Constructor Description CacheHelper()
-
Method Summary
Modifier and Type Method Description static synchronized DownloadManagergetDownloadManager()voidpreCacheVideo(Context context, Uri uri, long length, CacheWriter.ProgressListener progressListener)需要自己创建线程length 是需要提前缓存的长度 voidpreCacheVideo(Context context, Uri uri, File cacheDir, boolean preview, String uerAgent, Map<String, String> mapHeadData, long length, CacheWriter.ProgressListener progressListener)需要自己创建线程length 是需要提前缓存的长度 voidcancel()static synchronized voidensureDownloadManagerInitialized(Context context, File cacheDir, boolean preview, String uerAgent, Map<String, String> mapHeadData)static synchronized voiddownload(String contentId, Uri contentUri)static synchronized voidpause()static synchronized voidrelease()-
-
Method Detail
-
getDownloadManager
static synchronized DownloadManager getDownloadManager()
-
preCacheVideo
void preCacheVideo(Context context, Uri uri, long length, CacheWriter.ProgressListener progressListener)
需要自己创建线程length 是需要提前缓存的长度
-
preCacheVideo
void preCacheVideo(Context context, Uri uri, File cacheDir, boolean preview, String uerAgent, Map<String, String> mapHeadData, long length, CacheWriter.ProgressListener progressListener)
需要自己创建线程length 是需要提前缓存的长度
-
cancel
void cancel()
-
ensureDownloadManagerInitialized
static synchronized void ensureDownloadManagerInitialized(Context context, File cacheDir, boolean preview, String uerAgent, Map<String, String> mapHeadData)
-
pause
static synchronized void pause()
-
release
static synchronized void release()
-
-
-
-