Downloads and offline playback series¶
Get available tracks for download¶
To get information about which different tracks are available to choose between when downloading an
asset, use IEnigmaDownload#getDownloadableInfo
.
IEnigmaDownload enigmaDownload = new EnigmaDownload(businessUnit);
enigmaDownload.getDownloadableInfo(assetID, session, new BaseResultHandler<IDownloadableInfo>() {
@Override
public void onResult(IDownloadableInfo result) {
List<VideoDownloadable> videoTrackChoices = result.getVideoTracks();
List<AudioDownloadable> audioTrackChoices = result.getAudioTracks();
List<SubtitleDownloadable> subtitleTracksChoices = result.getSubtitleTracks();
// ... use later when making a DownloadStartRequest ... //
}
@Override
public void onError(EnigmaError error) {
// ... handle error ... //
}
}, handler);
IDownloadableInfo
object we can get video tracks, audio tracks and subtitle tracks.
public class VideoDownloadable implements IDownloadablePart {
...
public String getName() {...}
public int getBitrate() {...}
public long getFileSize() {...}
...
}
public class AudioDownloadable implements IDownloadablePart {
...
public String getName() {...}
public int getBitrate() {...}
public String getLanguage() {...}
public long getFileSize() {...}
...
}
public class SubtitleDownloadable implements IDownloadablePart {
...
public String getName() {...}
...
}
Table of Contents
Prerequisites
Gradle dependencies
Check if an asset is downloadable
Using the download API
• Get available tracks for download (current)
Start asset download
Managing ongoing downloads
Listing downloaded assets
Start playback of a downloaded asset
Remove downloaded assets
Downloads app