-
- All Implemented Interfaces:
-
com.google.android.exoplayer2.upstream.Loader.Callback
public class DashDownloadable extends MediaDownloadable implements Loader.Callback<MediaPresentationDescriptionLoadable>
A MediaDownloadable responsible to manage the download of a Dash Video and its assets.
-
-
Constructor Summary
Constructors Constructor Description DashDownloadable(Context context, Video video, MediaDownloadable.DownloadEventListener downloadEventListener, RequestConfig requestConfig)
-
Method Summary
Modifier and Type Method Description void
getMediaFormatTracksAvailable(@NonNull() MediaDownloadable.MediaFormatListener mediaFormatListener)
An asynchronous call to retrieve the MediaFormat tracks available for the current video. boolean
requestDownload()
Requests the media to be downloaded asynchronously. void
estimatedSize(MediaDownloadable.OnVideoSizeCallback callback)
Returns the estimated total size of the media, which includes all assets such video, audioand subtitles. void
onLoadCompleted(MediaPresentationDescriptionLoadable loadable, long elapsedRealtimeMs, long loadDurationMs)
void
onLoadCanceled(MediaPresentationDescriptionLoadable loadable, long elapsedRealtimeMs, long loadDurationMs, boolean released)
Loader.LoadErrorAction
onLoadError(MediaPresentationDescriptionLoadable loadable, long elapsedRealtimeMs, long loadDurationMs, IOException error, int errorCount)
-
Methods inherited from class com.brightcove.player.offline.MediaDownloadable
cancelDownload, create, create, deleteDownload, estimatedSize, getConfigurationBundle, getDownloadDirectory, getDownloadStatus, getEstimatedSize, getMediaFormatTracksAvailable, pauseDownload, registerDownloadable, resumeDownload, setConfigurationBundle, setVideoBitrate
-
Methods inherited from class com.google.android.exoplayer2.upstream.Loader.Callback
onLoadCanceled, onLoadCompleted, onLoadError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
DashDownloadable
DashDownloadable(Context context, Video video, MediaDownloadable.DownloadEventListener downloadEventListener, RequestConfig requestConfig)
-
-
Method Detail
-
getMediaFormatTracksAvailable
void getMediaFormatTracksAvailable(@NonNull() MediaDownloadable.MediaFormatListener mediaFormatListener)
An asynchronous call to retrieve the MediaFormat tracks available for the current video.The result will be given through the com.brightcove.player.offline.MediaDownloadable.MediaFormatListener listener.
Note: Only the video type DASH is currently supported.
- Parameters:
mediaFormatListener
- the media format listener
-
requestDownload
boolean requestDownload()
Requests the media to be downloaded asynchronously.
-
estimatedSize
void estimatedSize(MediaDownloadable.OnVideoSizeCallback callback)
Returns the estimated total size of the media, which includes all assets such video, audioand subtitles.
The actual size of the media that will be used by the host device may vary based on thepartition type and format of the storage.This method requires the Media Manifest to estimate the size, thereforeit might download the manifest and store it to the directory provided in the ( object in the constructor, if it has not been done already.
- Parameters:
callback
- the approximate size of the media.
-
onLoadCompleted
void onLoadCompleted(MediaPresentationDescriptionLoadable loadable, long elapsedRealtimeMs, long loadDurationMs)
-
onLoadCanceled
void onLoadCanceled(MediaPresentationDescriptionLoadable loadable, long elapsedRealtimeMs, long loadDurationMs, boolean released)
-
onLoadError
Loader.LoadErrorAction onLoadError(MediaPresentationDescriptionLoadable loadable, long elapsedRealtimeMs, long loadDurationMs, IOException error, int errorCount)
-
-
-
-