public abstract class AbstractOfflineCatalog extends Catalog
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractOfflineCatalog.Builder<T extends AbstractOfflineCatalog.Builder<T>>
An abstract Builder which sets the bases to create the OfflineCatalog object.
|
Catalog.AbstractBuilder<T extends Catalog.AbstractBuilder<T>>
DEFAULT_EDGE_BASE_URL, DEFAULT_EPA_BASE_URL
eventEmitter, listenerTokens
Modifier | Constructor and Description |
---|---|
protected |
AbstractOfflineCatalog(AbstractOfflineCatalog.Builder<?> builder)
The Catalog constructor using the
AbstractOfflineCatalog.Builder |
|
AbstractOfflineCatalog(android.content.Context context,
EventEmitter eventEmitter,
java.lang.String account,
java.lang.String policy,
java.lang.String baseURL)
Deprecated.
|
|
AbstractOfflineCatalog(android.content.Context context,
EventEmitter eventEmitter,
java.lang.String account,
java.lang.String policy,
java.lang.String baseURL,
DownloadFileCreator downloadFileCreator)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addDownloadEventListener(MediaDownloadable.DownloadEventListener downloadEventListener)
Adds the specified to the list of listeners that will be notified when a download event is
raised.
|
boolean |
cancelVideoDownload(java.lang.String videoId)
Cancels a video download that has not been completed yet.
|
void |
cancelVideoDownload(java.lang.String videoId,
OfflineCallback<java.lang.Boolean> callback)
Asynchronously cancels a video download that has not been completed yet.
|
boolean |
cancelVideoDownload(Video video)
Cancels a video download that has not been completed yet.
|
void |
cancelVideoDownload(Video video,
OfflineCallback<java.lang.Boolean> callback)
Asynchronously cancels a video download that has not been completed yet.
|
boolean |
deleteVideo(java.lang.String videoId)
Deletes the offline copy of the specified video.
|
void |
deleteVideo(java.lang.String videoId,
OfflineCallback<java.lang.Boolean> callback)
Asynchronously deletes the offline copy of the specified video.
|
boolean |
deleteVideo(Video video)
This method can be used to remove all assets related to a single video from the host device.
|
void |
deleteVideo(Video video,
OfflineCallback<java.lang.Boolean> callback)
Asynchronously deletes the offline copy of the specified video.
|
DownloadStatus |
downloadVideo(Video video)
This method is used to request a single video to be downloaded for offline playback.
|
void |
downloadVideo(Video video,
OfflineCallback<DownloadStatus> callback)
This method is used to request a single video to be downloaded asynchronously for offline
playback.
|
long |
estimateSize(Video video)
This method returns the approximate total size for a Video already downloaded or with a download
in progress.
|
void |
estimateSize(Video video,
MediaDownloadable.OnVideoSizeCallback callback)
This method is used to determine the approximate total size of all assets needed to store
the video on the host device.
|
java.util.List<Video> |
findAllQueuedVideoDownload()
This method returns the list of videos that have been queued for download.
|
void |
findAllQueuedVideoDownload(OfflineCallback<java.util.List<Video>> callback)
Asynchronously returns the list of videos that have been queued for download.
|
java.util.List<Video> |
findAllVideoDownload(int status)
Finds all offline video downloads with specified status.
|
void |
findAllVideoDownload(int status,
OfflineCallback<java.util.List<Video>> callback)
Asynchronously finds all offline video downloads with specified status.
|
Video |
findOfflineVideoById(java.lang.String videoId)
Finds the offline copy of the specified video, if it exists.
|
Video |
findOfflineVideoById(java.lang.String videoId,
HttpRequestConfig httpRequestConfig)
Finds the offline copy of the specified video, if it exists.
|
void |
findOfflineVideoById(java.lang.String videoId,
HttpRequestConfig httpRequestConfig,
OfflineCallback<Video> callback)
Asynchronously finds the offline copy of the specified video, if it exists.
|
void |
findOfflineVideoById(java.lang.String videoId,
OfflineCallback<Video> callback)
Asynchronously finds the offline copy of the specified video, if it exists.
|
java.io.File |
getDownloadPath()
Gets the current base path that will be used to store new offline video requests.
|
void |
getMediaFormatTracksAvailable(Video video,
MediaDownloadable.MediaFormatListener mediaFormatListener)
An asynchronous call to retrieve the MediaFormat tracks available for a given video.
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Get the Map of properties for this Offline Catalog
|
DownloadStatus |
getVideoDownloadStatus(java.lang.String videoId)
Gets the status of previous video download request.
|
void |
getVideoDownloadStatus(java.lang.String videoId,
OfflineCallback<DownloadStatus> callback)
Asynchronously gets the status of previous video download request.
|
DownloadStatus |
getVideoDownloadStatus(Video video)
Gets the status of previous video download request.
|
void |
getVideoDownloadStatus(Video video,
OfflineCallback<DownloadStatus> callback)
Asynchronously gets the status of previous video download request.
|
boolean |
isDownloadPathValid()
Checks whether the download path is valid.
|
boolean |
isMeteredDownloadAllowed()
Returns whether download over a metered network is allowed.
|
boolean |
isMobileDownloadAllowed()
This method can be used to check if the SDK is currently configured to use a cellular network
for downloading DRM media assets.
|
boolean |
isRoamingDownloadAllowed()
This method can be used to check if the SDK is currently configured to use a cellular roaming
network for downloading DRM media assets.
|
boolean |
isVideoDownloadable(Video video)
Checks if the video parameter can be downloaded and the directory to store the downloaded
video files is valid.
|
int |
pauseVideoDownload(java.lang.String videoId)
This method is used to pause a single video being downloaded.
|
void |
pauseVideoDownload(java.lang.String videoId,
OfflineCallback<java.lang.Integer> callback)
This method is used to asynchronously pause a single video being downloaded.
|
int |
pauseVideoDownload(Video video)
This method is used to pause a single video being downloaded.
|
void |
pauseVideoDownload(Video video,
OfflineCallback<java.lang.Integer> callback)
This method is used to asynchronously pause a single video being downloaded.
|
void |
releaseLicense(Video video,
EventListener listener)
Submits an offline playback license release request for the specified video asynchronously.
|
void |
removeDownloadEventListener(MediaDownloadable.DownloadEventListener downloadEventListener)
Removes the specified from the list of listeners that will be notified when a download event
is raised.
|
void |
requestPurchaseLicense(Video video,
EventListener listener)
Submits an offline playback purchase license request for the specified video asynchronously.
|
void |
requestPurchaseLicense(Video video,
EventListener listener,
CustomerRightsTokenConfig config)
Submits an offline playback purchase license request for the specified video asynchronously.
|
void |
requestPurchaseLicense(Video video,
EventListener listener,
HttpRequestConfig httpRequestConfig)
Submits an offline playback purchase license request for the specified video asynchronously.
|
void |
requestRentalLicense(Video video,
java.util.Date absoluteExpiration,
long playDuration,
EventListener listener)
Submits an offline playback rental license request for the specified video asynchronously.
|
void |
requestRentalLicense(Video video,
java.util.Date absoluteExpiration,
long playDuration,
EventListener listener,
CustomerRightsTokenConfig config)
Submits an offline playback rental license request for the specified video asynchronously.
|
void |
requestRentalLicense(Video video,
java.util.Date absoluteExpiration,
long playDuration,
EventListener listener,
HttpRequestConfig httpRequestConfig)
Submits an offline playback rental license request for the specified video asynchronously.
|
int |
resumeVideoDownload(java.lang.String videoId)
This method is used to resume a single video being downloaded which was previously paused.
|
void |
resumeVideoDownload(java.lang.String videoId,
OfflineCallback<java.lang.Integer> callback)
This method is used to asynchronously resume the download of a video which was previously
paused.
|
int |
resumeVideoDownload(Video video)
This method is used to resume the download of a video which was previously paused.
|
void |
resumeVideoDownload(Video video,
OfflineCallback<java.lang.Integer> callback)
This method is used to asynchronously resume the download of a video which was previously
paused.
|
void |
setDownloadPath(DownloadFileCreator downloadFileCreator)
Sets the
DownloadFileCreator to retrieve the base path that must be used to store
new offline video requests. |
void |
setDownloadPath(java.io.File downloadPath)
Sets the base path that must be used to store new offline video requests.
|
void |
setMeteredDownloadAllowed(boolean meteredDownloadAllowed)
Sets whether download over a metered network is allowed.
|
void |
setMobileDownloadAllowed(boolean mobileDownloadAllowed)
This method can be used to configure the SDK whether the cellular network may be used to
download DRM media assets or not.
|
void |
setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Set the optional properties of this Offline Catalog.
|
void |
setRoamingDownloadAllowed(boolean roamingDownloadAllowed)
This method can be used to configure the SDK whether the cellular roaming network may be used
downloading DRM media assets.
|
void |
setVideoBitrate(int videoBitrate)
Sets the video bitrate cap which will be used to determine what rendition will be downloaded.
|
void |
terminate()
Terminates threads created to perform asynchronous operations.
|
findPlaylistByID, findPlaylistByID, findPlaylistByID, findPlaylistByID, findPlaylistByReferenceID, findPlaylistByReferenceID, findPlaylistByReferenceID, findPlaylistByReferenceID, findVideoByID, findVideoByID, findVideoByID, findVideoByID, findVideoByReferenceID, findVideoByReferenceID, findVideoByReferenceID, findVideoByReferenceID
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
@Deprecated public AbstractOfflineCatalog(android.content.Context context, EventEmitter eventEmitter, java.lang.String account, java.lang.String policy, java.lang.String baseURL)
AbstractOfflineCatalog
. Creates an ExternalFileCreator
as its DownloadFileCreator
.context
- an instance of a Context
.eventEmitter
- an instance of an EventEmitter
.account
- Account id from VideoCloud.policy
- Policy Key from VideoCloud.baseURL
- Playback API base url.@Deprecated public AbstractOfflineCatalog(android.content.Context context, EventEmitter eventEmitter, java.lang.String account, java.lang.String policy, java.lang.String baseURL, @NonNull DownloadFileCreator downloadFileCreator)
AbstractOfflineCatalog
with a custom DownloadFileCreator
.context
- an instance of a Context
.eventEmitter
- an instance of an EventEmitter
.account
- Account id from VideoCloud.policy
- Policy Key from VideoCloud.baseURL
- Playback API base url.downloadFileCreator
- DownloadFileCreator
to retrieve a directory to store offline content.protected AbstractOfflineCatalog(AbstractOfflineCatalog.Builder<?> builder)
AbstractOfflineCatalog.Builder
public void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
properties
- A Map of optional propertiespublic java.util.Map<java.lang.String,java.lang.String> getProperties()
@Nullable public java.io.File getDownloadPath()
public void setDownloadPath(@NonNull java.io.File downloadPath) throws InvalidDownloadPathException
Sets the base path that must be used to store new offline video requests. Changing the location will not change location of any downloads that are either currently being downloaded or have been downloaded already.
Please note that by default the AbstractOfflineCatalog
uses a secure location on the host
device that is accessible only by the host application and will be cleaned automatically, if
the host application is uninstalled. If you change this path, the you will be responsible
ensure it is secure and will be cleaned automatically
Though Android OS will make an attempt to clean the download media placed this folder, the Android OS does not guarantee that will be in fact clean all the files.
downloadPath
- the download path. Must be a file URI to a path on external storage,
and the calling application must have the WRITE_EXTERNAL_STORAGE
permission.InvalidDownloadPathException
- when the download path
is not valid.isDownloadPathValid()
,
RequestConfig.setDownloadPath(File)
public void setDownloadPath(@NonNull DownloadFileCreator downloadFileCreator) throws InvalidDownloadPathException
Sets the DownloadFileCreator
to retrieve the base path that must be used to store
new offline video requests. Changing the location will not change location of any downloads
that are either currently being downloaded or have been downloaded already.
By default a ExternalFileCreator
is created when calling the default constructor
downloadFileCreator
- to set
.InvalidDownloadPathException
- when the download path is not valid.isDownloadPathValid()
public boolean isVideoDownloadable(@Nullable Video video)
Checks if the video parameter can be downloaded and the directory to store the downloaded video files is valid.
Suggestion: If your app has a download button use this method to check if you can show it.
video
- Video to check if it is possible to download.DownloadFileCreator
,
isDownloadPathValid().
public boolean isDownloadPathValid()
Checks whether the download path is valid.
public boolean isMobileDownloadAllowed()
By default the SDK will not use a cellular network. This setting must be enabled explicitly by the developer.
public void setMobileDownloadAllowed(boolean mobileDownloadAllowed)
The developer will be responsible to include the necessary logic in the host application to prompt the user and expose the setting to the user.
mobileDownloadAllowed
- true if cellular network is allowed.public boolean isRoamingDownloadAllowed()
By default the SDK will not use cellular roaming network. This setting must be enabled explicitly by the developer.
public void setRoamingDownloadAllowed(boolean roamingDownloadAllowed)
The developer will be responsible to include the necessary logic in the host application to prompt the user and expose the setting to the user.
roamingDownloadAllowed
- true if roaming is allowed.public boolean isMeteredDownloadAllowed()
setMeteredDownloadAllowed(boolean)
public void setMeteredDownloadAllowed(boolean meteredDownloadAllowed)
meteredDownloadAllowed
- whether metered is allowedpublic void setVideoBitrate(int videoBitrate)
videoBitrate
- the video bitratepublic void addDownloadEventListener(@NonNull MediaDownloadable.DownloadEventListener downloadEventListener)
downloadEventListener
- the download event listenerMediaDownloadable.DownloadEventListener
public void removeDownloadEventListener(@NonNull MediaDownloadable.DownloadEventListener downloadEventListener)
downloadEventListener
- the download event listenerMediaDownloadable.DownloadEventListener
public long estimateSize(Video video)
estimateSize(Video, MediaDownloadable.OnVideoSizeCallback)
for this scenario.video
- - reference to the video to be estimated.estimateSize(Video, MediaDownloadable.OnVideoSizeCallback)
public void estimateSize(@NonNull Video video, @NonNull MediaDownloadable.OnVideoSizeCallback callback) throws InvalidDownloadPathException
getDownloadPath()
, if it has not been done already.
If this directory is invalid, it will throw a InvalidDownloadPathException
.video
- reference to the video to be estimated.callback
- to return the video size.InvalidDownloadPathException
- when the current download path is invalid.isDownloadPathValid()
public void getMediaFormatTracksAvailable(@NonNull Video video, @NonNull MediaDownloadable.MediaFormatListener mediaFormatListener) throws InvalidDownloadPathException
MediaDownloadable.MediaFormatListener
listener.
NOTE: Only the video type DeliveryType.DASH
is currently supported.
This method requires the Media Manifest to retrieve the requested information, therefore
it might download the manifest and store it to the directory provided by
getDownloadPath()
, if it has not been done already.
If this directory is invalid, it will throw a InvalidDownloadPathException
.
video
- video to retrieve MediaFormatTracks from.mediaFormatListener
- callback to return MediaDownloadable
InvalidDownloadPathException
- when the current download path is invalid.public DownloadStatus downloadVideo(@NonNull Video video)
downloadVideo(Video, OfflineCallback)
.
Please register a MediaDownloadable.DownloadEventListener
to receive notifications
when the download is completed, cancelled or failed.
In case the download path is not available, this method will fail by calling
MediaDownloadable.DownloadEventListener#onDownloadFailed(Video, DownloadStatus)
with
the requested video and a DownloadStatus.StatusCode
= DownloadStatus.STATUS_NOT_QUEUED
and DownloadStatus.ReasonCode
= DownloadStatus.ERROR_DEVICE_NOT_FOUND
. The same
DownloadStatus
instance will be returned in the method.
video
- to be downloaded.DownloadStatus
with the current state of the download.DownloadStatus
,
downloadVideo(Video, OfflineCallback)
public void downloadVideo(@NonNull Video video, @NonNull OfflineCallback<DownloadStatus> callback)
Please register a MediaDownloadable.DownloadEventListener
to receive notifications
when the download is completed, cancelled or failed.
MediaDownloadable.DownloadEventListener#onDownloadFailed(Video, DownloadStatus)
with
the requested video and a DownloadStatus.StatusCode
= DownloadStatus.STATUS_NOT_QUEUED
and DownloadStatus.ReasonCode
= DownloadStatus.ERROR_DEVICE_NOT_FOUND
. The same
DownloadStatus
instance will be returned in the method.video
- The video to be downloaded.callback
- Provides the result of the operation. In case the download of the requested
video is started successfully, OfflineCallback.onSuccess(Object)
will be called to provide the DownloadStatus
, otherwise
OfflineCallback.onFailure(Throwable)
will be called.downloadVideo(Video)
public boolean cancelVideoDownload(@NonNull Video video)
Cancels a video download that has not been completed yet.
Operations to cancel the video download will block the UI thread. For asynchronous version
use cancelVideoDownload(Video, OfflineCallback)
.
If the video has been downloaded already, then calling this method will have no effect.
Please call deleteVideo(Video)
method instead to delete the video.
video
- the video to be cancelled.cancelVideoDownload(Video, OfflineCallback)
public void cancelVideoDownload(@NonNull Video video, @NonNull OfflineCallback<java.lang.Boolean> callback)
Asynchronously cancels a video download that has not been completed yet.
If the video has been downloaded already, then calling this method will have no effect.
Please call deleteVideo(Video)
method instead to delete the video.
video
- The video to be cancelled.callback
- Provides the result of the operation. In case the download of the requested
video has been canceled successfully,
OfflineCallback.onSuccess(Object)
will be called to provide a
Boolean
with its value as 'true' if the download was found in the
download queue and removed, otherwise 'false'.
OfflineCallback.onFailure(Throwable)
will be called in case there was
an error.public boolean cancelVideoDownload(@NonNull java.lang.String videoId)
Cancels a video download that has not been completed yet.
Operations to cancel the video download will block the UI thread. For asynchronous version
use cancelVideoDownload(String, OfflineCallback)
.
If the video has been downloaded already, then calling this method will have no effect.
Please call deleteVideo(Video)
method instead to delete the video.
videoId
- the video id.cancelVideoDownload(String, OfflineCallback)
public void cancelVideoDownload(@NonNull java.lang.String videoId, @NonNull OfflineCallback<java.lang.Boolean> callback)
Asynchronously cancels a video download that has not been completed yet. If the video has
been downloaded already, then calling this method will have no effect.
Please call deleteVideo(Video)
method instead to delete the video.
videoId
- The id of the video to be cancelled.callback
- Provides the result of the operation. In case the download of the requested
video has been canceled successfully,
OfflineCallback.onSuccess(Object)
will be called to provide a
Boolean
with its value as 'true' if the download was found in the
download queue and removed, otherwise 'false'.
OfflineCallback.onFailure(Throwable)
will be called in case there was
an error.public int pauseVideoDownload(Video video)
pauseVideoDownload(Video, OfflineCallback)
.video
- the video to be paused.java.lang.UnsupportedOperationException
- if the underlying download process does not support
pausing video downloads.pauseVideoDownload(Video, OfflineCallback)
public void pauseVideoDownload(@NonNull Video video, @NonNull OfflineCallback<java.lang.Integer> callback)
video
- The video to be paused.callback
- Provides the result of the operation. In case the download of the requested
video has been paused successfully, OfflineCallback.onSuccess(Object)
will be called to provide an Integer
value of its current
DownloadStatus.StatusCode
.
OfflineCallback.onFailure(Throwable)
will be called in case there was
an error.public int pauseVideoDownload(@NonNull java.lang.String videoId)
pauseVideoDownload(String, OfflineCallback)
.videoId
- the video id.java.lang.UnsupportedOperationException
- if the underlying download process does not support
pausing video downloads.pauseVideoDownload(String, OfflineCallback)
public void pauseVideoDownload(@NonNull java.lang.String videoId, @NonNull OfflineCallback<java.lang.Integer> callback)
videoId
- The id of the video to be paused.callback
- Provides the result of the operation. In case the download of the requested
video has been paused successfully, OfflineCallback.onSuccess(Object)
will be called to provide an Integer
value of its current
DownloadStatus.StatusCode
.
OfflineCallback.onFailure(Throwable)
will be called in case there was
an error.public int resumeVideoDownload(@NonNull Video video)
resumeVideoDownload(Video, OfflineCallback)
.video
- the video to resume its download.java.lang.UnsupportedOperationException
- if the underlying download process does not support
pausing video downloads.resumeVideoDownload(Video, OfflineCallback)
public void resumeVideoDownload(@NonNull Video video, @NonNull OfflineCallback<java.lang.Integer> callback)
video
- the video to resume its download.callback
- Provides the result of the operation. In case the download of the requested
video has been resumed successfully, OfflineCallback.onSuccess(Object)
will be called to provide an Integer
value of its current
DownloadStatus.StatusCode
.
OfflineCallback.onFailure(Throwable)
will be called in case there was
an error. UnsupportedOperationException
if the underlying
download process does not support pausing video downloads.public int resumeVideoDownload(@NonNull java.lang.String videoId)
resumeVideoDownload(String, OfflineCallback)
.videoId
- the video id.java.lang.UnsupportedOperationException
- if the underlying download process does not support
pausing video downloads.resumeVideoDownload(String, OfflineCallback)
public void resumeVideoDownload(@NonNull java.lang.String videoId, @NonNull OfflineCallback<java.lang.Integer> callback)
videoId
- the Id of the video to resume its download.callback
- Provides the result of the operation. In case the download of the requested
video has been resumed successfully, OfflineCallback.onSuccess(Object)
will be called to provide an Integer
value of its current
DownloadStatus.StatusCode
.
OfflineCallback.onFailure(Throwable)
will be called in case there was
an error. UnsupportedOperationException
if the underlying
download process does not support pausing video downloads.public boolean deleteVideo(@NonNull Video video)
releaseLicense(Video, EventListener)
to release and remove the license.
Operations to delete the video download will block the UI thread. For asynchronous version
use deleteVideo(Video, OfflineCallback)
.video
- to be deleted.deleteVideo(Video, OfflineCallback)
public void deleteVideo(@NonNull Video video, @NonNull OfflineCallback<java.lang.Boolean> callback)
releaseLicense(Video, EventListener)
or saving the license key set identifier for
future reuse.video
- The video to be deleted.callback
- Provides the result of the operation. In case the video has been successfully
removed, OfflineCallback#onSuccess(Object) will be called to provide
a {@link Boolean} with its value as 'true' if the video was deleted,
otherwise 'false'.
{@link OfflineCallback#onFailure(Throwable)} will be called in case there was
an error.public boolean deleteVideo(@NonNull java.lang.String videoId)
releaseLicense(Video, EventListener)
or saving the license key set identifier for
future reuse.
Operations to delete the video download will block the UI thread. For asynchronous version
use deleteVideo(String, OfflineCallback)
.videoId
- the unique identified of the video to be deleted.deleteVideo(String, OfflineCallback)
public void deleteVideo(@NonNull java.lang.String videoId, @NonNull OfflineCallback<java.lang.Boolean> callback)
releaseLicense(Video, EventListener)
or saving the license key set identifier for
future reuse.videoId
- The Id of the video to be deleted.callback
- Provides the result of the operation. In case the video has been successfully
removed, OfflineCallback#onSuccess(Object) will be called to provide
a {@link Boolean} with its value as 'true' if the video was deleted,
otherwise 'false'.
{@link OfflineCallback#onFailure(Throwable)} will be called in case there was
an error.public DownloadStatus getVideoDownloadStatus(@NonNull Video video)
getVideoDownloadStatus(Video, OfflineCallback)
.video
- the video being downloaded.getVideoDownloadStatus(Video, OfflineCallback)
public void getVideoDownloadStatus(@NonNull Video video, @NonNull OfflineCallback<DownloadStatus> callback)
video
- The video which DownloadStatus
will be retrieved.callback
- Provides the result of the operation. In case the DownloadStatus
has
been retrieved successfully, OfflineCallback#onSuccess(Object) will be
called to provide the {@link DownloadStatus} from the requested video.
{@link OfflineCallback#onFailure(Throwable)} will be called in case there was
an error.@NonNull public DownloadStatus getVideoDownloadStatus(@NonNull java.lang.String videoId)
getVideoDownloadStatus(String, OfflineCallback)
.videoId
- The id of the video which DownloadStatus
will be retrieved.getVideoDownloadStatus(String, OfflineCallback)
public void getVideoDownloadStatus(@NonNull java.lang.String videoId, @NonNull OfflineCallback<DownloadStatus> callback)
videoId
- The id of the video which DownloadStatus
will be retrieved.callback
- Provides the result of the operation. In case the DownloadStatus
has
been retrieved successfully, OfflineCallback#onSuccess(Object) will be
called to provide the {@link DownloadStatus} from the requested video.
{@link OfflineCallback#onFailure(Throwable)} will be called in case there was
an error.@NonNull public java.util.List<Video> findAllQueuedVideoDownload()
getVideoDownloadStatus(Video)
to find the current download status of each video.
Operations to retrieve the queued videos will block the UI thread. For asynchronous version
use findAllQueuedVideoDownload(OfflineCallback)
.findAllQueuedVideoDownload(OfflineCallback)
public void findAllQueuedVideoDownload(@NonNull OfflineCallback<java.util.List<Video>> callback)
getVideoDownloadStatus(Video)
to find the
current download status of each video.callback
- Provides the result of the operation. OfflineCallback#onSuccess(Object)
will be called to provide the {@link List@NonNull public java.util.List<Video> findAllVideoDownload(int status)
findAllVideoDownload(int, OfflineCallback)
.status
- the status of the video download.findAllVideoDownload(int, OfflineCallback)
public void findAllVideoDownload(int status, @NonNull OfflineCallback<java.util.List<Video>> callback)
status
- the status of the video download.callback
- Provides the result of the operation. OfflineCallback#onSuccess(Object)
will be called to provide the {@link List@Nullable public Video findOfflineVideoById(java.lang.String videoId)
getVideoDownloadStatus(Video)
method to determine the current status of the offline
copy.
Operations to retrieve the video will block the UI thread. For asynchronous version
use findOfflineVideoById(String, OfflineCallback)
.videoId
- the video id.findOfflineVideoById(String, OfflineCallback)
@Nullable public Video findOfflineVideoById(java.lang.String videoId, @NonNull HttpRequestConfig httpRequestConfig)
getVideoDownloadStatus(Video)
method to determine the current status of the offline
copy.
Operations to retrieve the video will block the UI thread. For asynchronous version
use findOfflineVideoById(String, HttpRequestConfig, OfflineCallback)
.videoId
- The id of the video to retrieve.httpRequestConfig
- Http parameters when retrieving the video.
Use HttpRequestConfig.empty()
instead of null.public void findOfflineVideoById(java.lang.String videoId, @NonNull OfflineCallback<Video> callback)
getVideoDownloadStatus(Video)
method to determine the current status of the offline
copy.videoId
- The id of the video to retrieve.callback
- Provides the result of the operation. OfflineCallback#onSuccess(Object)
will be called to provide the {@link Video} requested or null if the video
was not found.
{@link OfflineCallback#onFailure(Throwable)} will be called in case there was
an error.public void findOfflineVideoById(java.lang.String videoId, @NonNull HttpRequestConfig httpRequestConfig, @NonNull OfflineCallback<Video> callback)
getVideoDownloadStatus(Video)
method to determine the current status of the offline
copy.videoId
- The id of the video to retrieve.httpRequestConfig
- Http parameters when retrieving the video.
Use HttpRequestConfig.empty()
instead of null.callback
- Provides the result of the operation. OfflineCallback#onSuccess(Object)
will be called to provide the {@link Video} requested or null if the video
was not found.public void requestRentalLicense(@NonNull Video video, @NonNull java.util.Date absoluteExpiration, long playDuration, @NonNull EventListener listener)
video
- the video for which the offline playback license should be acquired.absoluteExpiration
- defines how long the license is valid to start playback.playDuration
- defines in milliseconds how long the content can be consumed
after the start of playback.listener
- reference to a listener that will be notified about the outcome of the request.public void requestRentalLicense(@NonNull Video video, @NonNull java.util.Date absoluteExpiration, long playDuration, @NonNull EventListener listener, @NonNull CustomerRightsTokenConfig config)
video
- the video for which the offline playback license should be acquired.absoluteExpiration
- defines how long the license is valid to start playback.playDuration
- defines in milliseconds how long the content can be consumed
after the start of playback.listener
- reference to a listener that will be notified about the outcome of the request.config
- defines additional configuration for the license requestpublic void requestRentalLicense(@NonNull Video video, @NonNull java.util.Date absoluteExpiration, long playDuration, @NonNull EventListener listener, @NonNull HttpRequestConfig httpRequestConfig)
video
- the video for which the offline playback license should be acquired.absoluteExpiration
- defines how long the license is valid to start playback.playDuration
- defines in milliseconds how long the content can be consumed
after the start of playback.listener
- reference to a listener that will be notified about the outcome of
the request.httpRequestConfig
- Http parameters when retrieving the video.
Use HttpRequestConfig.empty()
instead of null.public void requestPurchaseLicense(@NonNull Video video, @NonNull EventListener listener)
video
- the video for which the offline playback license should be acquired.listener
- reference to a listener that will be notified about the outcome of the request.public void requestPurchaseLicense(@NonNull Video video, @NonNull EventListener listener, @NonNull CustomerRightsTokenConfig config)
video
- the video for which the offline playback license should be acquired.listener
- reference to a listener that will be notified about the outcome of the request.config
- defines additional configuration for the license requestpublic void requestPurchaseLicense(@NonNull Video video, @NonNull EventListener listener, @NonNull HttpRequestConfig httpRequestConfig)
video
- the video for which the offline playback license should be acquired.listener
- reference to a listener that will be notified about the outcome of the request.httpRequestConfig
- additional parameters for the license request.public void releaseLicense(@NonNull Video video, @NonNull EventListener listener)
video
- the video for which the offline playback license should be released.listener
- reference to a listener that will be notified about the outcome of the request.public void terminate()