Class SsDownloader

  • All Implemented Interfaces:
    Downloader

    public final class SsDownloader
    extends SegmentDownloader<SsManifest>
    A downloader for SmoothStreaming 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 track of the first stream element.
     SsDownloader ssDownloader =
         new SsDownloader(
             new MediaItem.Builder()
                 .setUri(manifestUri)
                 .setStreamKeys(Collections.singletonList(new StreamKey(0, 0)))
                 .build(),
             cacheDataSourceFactory);
     // Perform the download.
     ssDownloader.download(progressListener);
     // Use the downloaded data for playback.
     SsMediaSource mediaSource =
         new SsMediaSource.Factory(cacheDataSourceFactory).createMediaSource(mediaItem);