public final class ProgressiveDownloadHelper extends DownloadHelper
DownloadHelper for progressive streams.DownloadHelper.Callback| Constructor and Description |
|---|
ProgressiveDownloadHelper(android.net.Uri uri) |
ProgressiveDownloadHelper(android.net.Uri uri,
java.lang.String customCacheKey) |
| Modifier and Type | Method and Description |
|---|---|
ProgressiveDownloadAction |
getDownloadAction(byte[] data,
java.util.List<TrackKey> trackKeys)
Builds a
DownloadAction for downloading the specified tracks. |
int |
getPeriodCount()
Returns the number of periods for which media is available.
|
ProgressiveDownloadAction |
getRemoveAction(byte[] data)
Builds a
DownloadAction for removing the media. |
TrackGroupArray |
getTrackGroups(int periodIndex)
Returns the track groups for the given period.
|
protected void |
prepareInternal()
Called on a background thread during preparation.
|
preparepublic ProgressiveDownloadHelper(android.net.Uri uri)
public ProgressiveDownloadHelper(android.net.Uri uri,
@Nullable
java.lang.String customCacheKey)
protected void prepareInternal()
DownloadHelperprepareInternal in class DownloadHelperpublic int getPeriodCount()
DownloadHelpergetPeriodCount in class DownloadHelperpublic TrackGroupArray getTrackGroups(int periodIndex)
DownloadHelpergetTrackGroups in class DownloadHelperperiodIndex - The period index.TrackGroupArray.EMPTY for single stream
content.public ProgressiveDownloadAction getDownloadAction(@Nullable byte[] data, java.util.List<TrackKey> trackKeys)
DownloadHelperDownloadAction for downloading the specified tracks. Must not be called until
after preparation completes.getDownloadAction in class DownloadHelperdata - Application provided data to store in DownloadAction.data.trackKeys - The selected tracks. If empty, all streams will be downloaded.DownloadAction.public ProgressiveDownloadAction getRemoveAction(@Nullable byte[] data)
DownloadHelperDownloadAction for removing the media. May be called in any state.getRemoveAction in class DownloadHelperdata - Application provided data to store in DownloadAction.data.DownloadAction.