Java Code Examples for com.google.android.exoplayer2.upstream.cache.CacheUtil#remove()

The following examples show how to use com.google.android.exoplayer2.upstream.cache.CacheUtil#remove() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExoSourceManager.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
/**
 * Cache需要release之后才能clear
 *
 * @param context
 * @param cacheDir
 * @param url
 */
public static void clearCache(Context context, File cacheDir, String url) {
    try {
        Cache cache = getCacheSingleInstance(context, cacheDir);
        if (!TextUtils.isEmpty(url)) {
            if (cache != null) {
                CacheUtil.remove(cache, CacheUtil.generateKey(Uri.parse(url)));
            }
        } else {
            if (cache != null) {
                for (String key : cache.getKeys()) {
                    CacheUtil.remove(cache, key);
                }
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 2
Source File: ProgressiveDownloader.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
@Override
public void remove() {
  CacheUtil.remove(dataSpec, cache, cacheKeyFactory);
}
 
Example 3
Source File: SegmentDownloader.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
private void removeDataSpec(DataSpec dataSpec) {
  CacheUtil.remove(dataSpec, cache, cacheKeyFactory);
}
 
Example 4
Source File: ProgressiveDownloader.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void remove() {
  CacheUtil.remove(dataSpec, cache, cacheKeyFactory);
}
 
Example 5
Source File: SegmentDownloader.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
private void removeDataSpec(DataSpec dataSpec) {
  CacheUtil.remove(dataSpec, cache, cacheKeyFactory);
}
 
Example 6
Source File: SegmentDownloader.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
private void removeUri(Uri uri) {
  CacheUtil.remove(cache, CacheUtil.generateKey(uri));
}
 
Example 7
Source File: ProgressiveDownloader.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void remove() {
  CacheUtil.remove(cache, CacheUtil.getKey(dataSpec));
}
 
Example 8
Source File: SegmentDownloader.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
private void removeUri(Uri uri) {
  CacheUtil.remove(cache, CacheUtil.generateKey(uri));
}
 
Example 9
Source File: ProgressiveDownloader.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void remove() {
  CacheUtil.remove(cache, CacheUtil.getKey(dataSpec));
}
 
Example 10
Source File: SegmentDownloader.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
private void removeDataSpec(DataSpec dataSpec) {
  CacheUtil.remove(dataSpec, cache, cacheKeyFactory);
}
 
Example 11
Source File: ProgressiveDownloader.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void remove() {
  CacheUtil.remove(dataSpec, cache, cacheKeyFactory);
}