Class DashDownloader

  • All Implemented Interfaces:

    public final class DashDownloader
    extends SegmentDownloader<DashManifest>
    Deprecated. 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()
             .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()
                 .setStreamKeys(Collections.singletonList(new StreamKey(0, 0, 0)))
     // Perform the download.;
     // Use the downloaded data for playback.
     DashMediaSource mediaSource =
         new DashMediaSource.Factory(cacheDataSourceFactory).createMediaSource(mediaItem);