mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Migrate uses of Uri-based ProgressiveDownloader() to MediaItem-based
The constructor that takes a Uri is deprecated PiperOrigin-RevId: 321148326
This commit is contained in:
parent
f83d478cc3
commit
f024045638
1 changed files with 7 additions and 1 deletions
|
|
@ -17,6 +17,7 @@ package com.google.android.exoplayer2.offline;
|
||||||
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import com.google.android.exoplayer2.MediaItem;
|
||||||
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
|
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
|
|
@ -107,7 +108,12 @@ public class DefaultDownloaderFactory implements DownloaderFactory {
|
||||||
switch (request.type) {
|
switch (request.type) {
|
||||||
case DownloadRequest.TYPE_PROGRESSIVE:
|
case DownloadRequest.TYPE_PROGRESSIVE:
|
||||||
return new ProgressiveDownloader(
|
return new ProgressiveDownloader(
|
||||||
request.uri, request.customCacheKey, cacheDataSourceFactory, executor);
|
new MediaItem.Builder()
|
||||||
|
.setUri(request.uri)
|
||||||
|
.setCustomCacheKey(request.customCacheKey)
|
||||||
|
.build(),
|
||||||
|
cacheDataSourceFactory,
|
||||||
|
executor);
|
||||||
case DownloadRequest.TYPE_DASH:
|
case DownloadRequest.TYPE_DASH:
|
||||||
return createDownloader(request, DASH_DOWNLOADER_CONSTRUCTOR);
|
return createDownloader(request, DASH_DOWNLOADER_CONSTRUCTOR);
|
||||||
case DownloadRequest.TYPE_HLS:
|
case DownloadRequest.TYPE_HLS:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue