Commit f0240456 by ibaker Committed by Oliver Woodman

Migrate uses of Uri-based ProgressiveDownloader() to MediaItem-based

The constructor that takes a Uri is deprecated

PiperOrigin-RevId: 321148326
parent f83d478c
......@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.offline;
import android.net.Uri;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
import com.google.android.exoplayer2.util.Assertions;
import java.lang.reflect.Constructor;
......@@ -107,7 +108,12 @@ public class DefaultDownloaderFactory implements DownloaderFactory {
switch (request.type) {
case DownloadRequest.TYPE_PROGRESSIVE:
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:
return createDownloader(request, DASH_DOWNLOADER_CONSTRUCTOR);
case DownloadRequest.TYPE_HLS:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment