Class DashDownloader

  • All Implemented Interfaces:
    Downloader

    public final class DashDownloader
    extends SegmentDownloader<DashManifest>
    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 DefaultHttpDataSourceFactory(userAgent));
     // 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);