Package com.castlabs.android.downloader
Class DownloadInfo
java.lang.Object
com.castlabs.android.downloader.DownloadInfo
Utility class that can be used to read download.info files
to limit the availability of tracks.
- Since:
- 3.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int[]The original indices of the selected video tracks -
Method Summary
Modifier and TypeMethodDescriptionReturns the audio tracks as a list ofTrackIndexOverrideobjects.Returns the list of sideloaded tracks.Returns the subtitle tracks as a list ofTrackIndexOverrideobjects.static DownloadInfoTakes a path to a Manifest and checks if next to the manifest file, a download info file exists.static voidwrite(String manifestPath, int[] videoTracks, Track[] audioTracks, Track[] subtitleTracks, Track[] sideloadedTracks) Writes the download information to a file.
-
Field Details
-
videoTracks
@Nullable public final int[] videoTracksThe original indices of the selected video tracks
-
-
Method Details
-
getAudioTracks
Returns the audio tracks as a list ofTrackIndexOverrideobjects.- Returns:
- The audio tracks, or
nullif no audio tracks are available.
-
getSubtitleTracks
Returns the subtitle tracks as a list ofTrackIndexOverrideobjects.- Returns:
- The subtitle tracks, or
nullif no subtitle tracks are available.
-
getSideloadedTracks
Returns the list of sideloaded tracks.- Returns:
- The sideloaded tracks, or
nullif no sideloaded tracks are available.
-
load
Takes a path to a Manifest and checks if next to the manifest file, a download info file exists. If so, a the info file is loaded and returned. Otherwise, an empty download info instance is returned.- Parameters:
pathToManifest- The path to the manifest file- Returns:
- The new info instance
-
write
public static void write(String manifestPath, @Nullable int[] videoTracks, @Nullable Track[] audioTracks, @Nullable Track[] subtitleTracks, @Nullable Track[] sideloadedTracks) throws IOException Writes the download information to a file.- Parameters:
manifestPath- The path to the manifest file.videoTracks- The video tracks to write.audioTracks- The audio tracks to write.subtitleTracks- The subtitle tracks to write.sideloadedTracks- The sideloaded tracks to write.- Throws:
IOException- If an I/O error occurs.
-