Class DashDownloader

  • All Implemented Interfaces:
    Downloader

    @Deprecated
    public final class DashDownloader
    extends SegmentDownloader<DashManifest>
    Deprecated.
    com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    A downloader for DASH streams.

    Example usage:

    
     SimpleCache cache = new SimpleCache(downloadFolder, new NoOpCacheEvictor(), databaseProvider);
     CacheDataSource.Factory cacheDataSourceFactory =
         new CacheDataSource.Factory()
             .setCache(cache)
             .setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory());
     // Create a downloader for the first representation of the first adaptation set of the first
     // period.
     DashDownloader dashDownloader =
         new DashDownloader(
             new MediaItem.Builder()
                 .setUri(manifestUrl)
                 .setStreamKeys(Collections.singletonList(new StreamKey(0, 0, 0)))
                 .build(),
             cacheDataSourceFactory);
     // Perform the download.
     dashDownloader.download(progressListener);
     // Use the downloaded data for playback.
     DashMediaSource mediaSource =
         new DashMediaSource.Factory(cacheDataSourceFactory).createMediaSource(mediaItem);