-
- All Implemented Interfaces:
-
com.brightcove.player.event.Component
public abstract class AbstractOfflineCatalog extends Catalog
-
-
Constructor Summary
Constructors Constructor Description AbstractOfflineCatalog(Context context, EventEmitter eventEmitter, String account, String policy, String baseURL)
Base constructor for AbstractOfflineCatalog. AbstractOfflineCatalog(Context context, EventEmitter eventEmitter, String account, String policy, String baseURL, DownloadFileCreator downloadFileCreator)
Constructor for AbstractOfflineCatalog with a custom DownloadFileCreator.
-
Method Summary
Modifier and Type Method Description File
getDownloadPath()
Gets the current base path that will be used to store new offline video requests. void
setDownloadPath(@NonNull() File downloadPath)
Sets the base path that must be used to store new offline video requests. void
setDownloadPath(@NonNull() DownloadFileCreator downloadFileCreator)
Sets the DownloadFileCreator to retrieve the base path that must be used to storenew offline video requests. boolean
isVideoDownloadable(@Nullable() Video video)
Checks if the video parameter can be downloaded and the directory to store the downloadedvideo files is valid. boolean
isDownloadPathValid()
Checks whether the download path is valid. boolean
isMobileDownloadAllowed()
This method can be used to check if the SDK is currently configured to use a cellular networkfor downloading DRM media assets. void
setMobileDownloadAllowed(boolean mobileDownloadAllowed)
This method can be used to configure the SDK whether the cellular network may be used todownload DRM media assets or not. boolean
isRoamingDownloadAllowed()
This method can be used to check if the SDK is currently configured to use a cellular roamingnetwork for downloading DRM media assets. void
setRoamingDownloadAllowed(boolean roamingDownloadAllowed)
This method can be used to configure the SDK whether the cellular roaming network may be useddownloading DRM media assets. boolean
isMeteredDownloadAllowed()
Returns whether download over a metered network is allowed.By default the SDK will not use a metered network. void
setMeteredDownloadAllowed(boolean meteredDownloadAllowed)
Sets whether download over a metered network is allowed. void
setVideoBitrate(int videoBitrate)
Sets the video bitrate cap which will be used to determine what rendition will be downloaded.If there's no rendition lower than the video bitrate provided, the next higher will be picked. void
addDownloadEventListener(@NonNull() MediaDownloadable.DownloadEventListener downloadEventListener)
Adds the specified to the list of listeners that will be notified when a download event israised. void
removeDownloadEventListener(@NonNull() MediaDownloadable.DownloadEventListener downloadEventListener)
Removes the specified from the list of listeners that will be notified when a download eventis raised. long
estimateSize(Video video)
This method returns the approximate total size for a Video already downloaded or with a downloadin progress. void
estimateSize(@NonNull() Video video, @NonNull() MediaDownloadable.OnVideoSizeCallback callback)
This method is used to determine the approximate total size of all assets needed to storethe video on the host device. void
getMediaFormatTracksAvailable(@NonNull() Video video, @NonNull() MediaDownloadable.MediaFormatListener mediaFormatListener)
An asynchronous call to retrieve the MediaFormat tracks available for a given video. DownloadStatus
downloadVideo(@NonNull() Video video)
This method is used to request a single video to be downloaded for offline playback.Operations to initialize the download will block the UI thread. void
downloadVideo(@NonNull() Video video, @NonNull() OfflineCallback<DownloadStatus> callback)
This method is used to request a single video to be downloaded asynchronously for offlineplayback. 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. void
cancelVideoDownload(@NonNull() Video video, @NonNull() OfflineCallback<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. boolean
cancelVideoDownload(@NonNull() String videoId)
Cancels a video download that has not been completed yet.Operations to cancel the video download will block the UI thread. void
cancelVideoDownload(@NonNull() String videoId, @NonNull() OfflineCallback<Boolean> callback)
Asynchronously cancels a video download that has not been completed yet. int
pauseVideoDownload(Video video)
This method is used to pause a single video being downloaded.Operations to pause the video download will block the UI thread. void
pauseVideoDownload(@NonNull() Video video, @NonNull() OfflineCallback<Integer> callback)
This method is used to asynchronously pause a single video being downloaded. int
pauseVideoDownload(@NonNull() String videoId)
This method is used to pause a single video being downloaded.Operations to pause the video download will block the UI thread. void
pauseVideoDownload(@NonNull() String videoId, @NonNull() OfflineCallback<Integer> callback)
This method is used to asynchronously pause a single video being downloaded. int
resumeVideoDownload(@NonNull() Video video)
This method is used to resume the download of a video which was previously paused.Operations to resume the video download will block the UI thread. void
resumeVideoDownload(@NonNull() Video video, @NonNull() OfflineCallback<Integer> callback)
This method is used to asynchronously resume the download of a video which was previouslypaused. int
resumeVideoDownload(@NonNull() String videoId)
This method is used to resume a single video being downloaded which was previously paused.Operations to resume the video download will block the UI thread. void
resumeVideoDownload(@NonNull() String videoId, @NonNull() OfflineCallback<Integer> callback)
This method is used to asynchronously resume the download of a video which was previouslypaused. boolean
deleteVideo(@NonNull() Video video)
This method can be used to remove all assets related to a single video from the host device.Deleting a video download will not cause the license to be deleted/released. void
deleteVideo(@NonNull() Video video, @NonNull() OfflineCallback<Boolean> callback)
Asynchronously deletes the offline copy of the specified video. boolean
deleteVideo(@NonNull() String videoId)
Deletes the offline copy of the specified video. void
deleteVideo(@NonNull() String videoId, @NonNull() OfflineCallback<Boolean> callback)
Asynchronously deletes the offline copy of the specified video. DownloadStatus
getVideoDownloadStatus(@NonNull() Video video)
Gets the status of previous video download request. void
getVideoDownloadStatus(@NonNull() Video video, @NonNull() OfflineCallback<DownloadStatus> callback)
Asynchronously gets the status of previous video download request. DownloadStatus
getVideoDownloadStatus(@NonNull() String videoId)
Gets the status of previous video download request. void
getVideoDownloadStatus(@NonNull() String videoId, @NonNull() OfflineCallback<DownloadStatus> callback)
Asynchronously gets the status of previous video download request. List<Video>
findAllQueuedVideoDownload()
This method returns the list of videos that have been queued for download.The result will include all videos that have been placed in the download queue, includingthose that have been downloaded successfully. void
findAllQueuedVideoDownload(@NonNull() OfflineCallback<List<Video>> callback)
Asynchronously returns the list of videos that have been queued for download. List<Video>
findAllVideoDownload(int status)
Finds all offline video downloads with specified status.Operations to retrieve all videos will block the UI thread. void
findAllVideoDownload(int status, @NonNull() OfflineCallback<List<Video>> callback)
Asynchronously finds all offline video downloads with specified status. Video
findOfflineVideoById(String videoId)
Finds the offline copy of the specified video, if it exists. Video
findOfflineVideoById(String videoId, @NonNull() HttpRequestConfig httpRequestConfig)
Finds the offline copy of the specified video, if it exists. void
findOfflineVideoById(String videoId, @NonNull() OfflineCallback<Video> callback)
Asynchronously finds the offline copy of the specified video, if it exists. void
findOfflineVideoById(String videoId, @NonNull() HttpRequestConfig httpRequestConfig, @NonNull() OfflineCallback<Video> callback)
Asynchronously finds the offline copy of the specified video, if it exists. void
requestRentalLicense(@NonNull() Video video, @NonNull() Date absoluteExpiration, long playDuration, @NonNull() EventListener listener)
Submits an offline playback rental license request for the specified video asynchronously.Upon successful acquisition of license, the video object will be updated to set the licensekey set identifier and actual expiration date. void
requestRentalLicense(@NonNull() Video video, @NonNull() Date absoluteExpiration, long playDuration, @NonNull() EventListener listener, @NonNull() CustomerRightsTokenConfig config)
Submits an offline playback rental license request for the specified video asynchronously.Upon successful acquisition of license, the video object will be updated to set the licensekey set identifier and actual expiration date. void
requestRentalLicense(@NonNull() Video video, @NonNull() Date absoluteExpiration, long playDuration, @NonNull() EventListener listener, @NonNull() HttpRequestConfig httpRequestConfig)
Submits an offline playback rental license request for the specified video asynchronously.Upon successful acquisition of license, the video object will be updated to set the licensekey set identifier and actual expiration date. void
requestPurchaseLicense(@NonNull() Video video, @NonNull() EventListener listener)
Submits an offline playback purchase license request for the specified video asynchronously.Upon successful acquisition of license, the video object will be updated to set the licensekey set identifier and actual expiration date. void
requestPurchaseLicense(@NonNull() Video video, @NonNull() EventListener listener, @NonNull() CustomerRightsTokenConfig config)
Submits an offline playback purchase license request for the specified video asynchronously.Upon successful acquisition of license, the video object will be updated to set the licensekey set identifier and actual expiration date. void
requestPurchaseLicense(@NonNull() Video video, @NonNull() EventListener listener, @NonNull() HttpRequestConfig httpRequestConfig)
Submits an offline playback purchase license request for the specified video asynchronously.Upon successful acquisition of license, the video object will be update to set the licensekey set identifier and actual expiration date. void
releaseLicense(@NonNull() Video video, @NonNull() EventListener listener)
Submits an offline playback license release request for the specified video asynchronously. void
terminate()
Terminates threads created to perform asynchronous operations. -
Methods inherited from class com.brightcove.player.edge.Catalog
empty, findPlaylistByID, findPlaylistByReferenceID, findVideoByID, findVideoByReferenceID, getInstance, getProperties
-
Methods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
AbstractOfflineCatalog
AbstractOfflineCatalog(Context context, EventEmitter eventEmitter, String account, String policy, String baseURL)
Base constructor for AbstractOfflineCatalog.- Parameters:
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.
-
AbstractOfflineCatalog
AbstractOfflineCatalog(Context context, EventEmitter eventEmitter, String account, String policy, String baseURL, DownloadFileCreator downloadFileCreator)
Constructor for AbstractOfflineCatalog with a custom DownloadFileCreator.- Parameters:
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.
-
-
Method Detail
-
getDownloadPath
@Nullable() File getDownloadPath()
Gets the current base path that will be used to store new offline video requests.
-
setDownloadPath
void setDownloadPath(@NonNull() File downloadPath)
Sets the base path that must be used to store new offline video requests. Changing thelocation will not change location of any downloads that are either currently being downloadedor have been downloaded already.
Please note that by default the AbstractOfflineCatalog uses a secure location on the hostdevice that is accessible only by the host application and will be cleaned automatically, ifthe host application is uninstalled. If you change this path, the you will be responsibleensure 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.
- Parameters:
downloadPath
- the download path.
-
setDownloadPath
void setDownloadPath(@NonNull() DownloadFileCreator downloadFileCreator)
Sets the DownloadFileCreator to retrieve the base path that must be used to storenew offline video requests. Changing the location will not change location of any downloadsthat are either currently being downloaded or have been downloaded already.
By default a ExternalFileCreator is created when calling the default constructor
- Parameters:
downloadFileCreator
- to set.
-
isVideoDownloadable
boolean isVideoDownloadable(@Nullable() Video video)
Checks if the video parameter can be downloaded and the directory to store the downloadedvideo files is valid.
Suggestion: If your app has a download button use this method to check if you can show it.
- Parameters:
video
- Video to check if it is possible to download.
-
isDownloadPathValid
boolean isDownloadPathValid()
Checks whether the download path is valid.
-
isMobileDownloadAllowed
boolean isMobileDownloadAllowed()
This method can be used to check if the SDK is currently configured to use a cellular networkfor downloading DRM media assets.
By default the SDK will not use a cellular network.This setting must be enabled explicitly by the developer.
-
setMobileDownloadAllowed
void setMobileDownloadAllowed(boolean mobileDownloadAllowed)
This method can be used to configure the SDK whether the cellular network may be used todownload DRM media assets or not.
The developer will be responsible to include the necessary logic in the host applicationto prompt the user and expose the setting to the user.
- Parameters:
mobileDownloadAllowed
- true if cellular network is allowed.
-
isRoamingDownloadAllowed
boolean isRoamingDownloadAllowed()
This method can be used to check if the SDK is currently configured to use a cellular roamingnetwork for downloading DRM media assets.
By default the SDK will not use cellular roaming network.This setting must be enabled explicitly by the developer.
-
setRoamingDownloadAllowed
void setRoamingDownloadAllowed(boolean roamingDownloadAllowed)
This method can be used to configure the SDK whether the cellular roaming network may be useddownloading DRM media assets.
The developer will be responsible to include the necessary logic in the host applicationto prompt the user and expose the setting to the user.
- Parameters:
roamingDownloadAllowed
- true if roaming is allowed.
-
isMeteredDownloadAllowed
boolean isMeteredDownloadAllowed()
Returns whether download over a metered network is allowed.By default the SDK will not use a metered network.
-
setMeteredDownloadAllowed
void setMeteredDownloadAllowed(boolean meteredDownloadAllowed)
Sets whether download over a metered network is allowed.
- Parameters:
meteredDownloadAllowed
- whether metered is allowed
-
setVideoBitrate
void setVideoBitrate(int videoBitrate)
Sets the video bitrate cap which will be used to determine what rendition will be downloaded.If there's no rendition lower than the video bitrate provided, the next higher will be picked.
- Parameters:
videoBitrate
- the video bitrate
-
addDownloadEventListener
void addDownloadEventListener(@NonNull() MediaDownloadable.DownloadEventListener downloadEventListener)
Adds the specified to the list of listeners that will be notified when a download event israised.
- Parameters:
downloadEventListener
- the download event listener
-
removeDownloadEventListener
void removeDownloadEventListener(@NonNull() MediaDownloadable.DownloadEventListener downloadEventListener)
Removes the specified from the list of listeners that will be notified when a download eventis raised.
- Parameters:
downloadEventListener
- the download event listener
-
estimateSize
long estimateSize(Video video)
This method returns the approximate total size for a Video already downloaded or with a downloadin progress. The estimate will include the size of the video, subtitles andother assets such as thumbnails. The actual size of the video on the host devicemay vary based on the partition type and format of the storage.If you attempt to get the estimated size for a Video that has not been downloaded,you will get a size of 0. Use the estimateSize for this scenario.
- Parameters:
video
- - reference to the video to be estimated.
-
estimateSize
void estimateSize(@NonNull() Video video, @NonNull() MediaDownloadable.OnVideoSizeCallback callback)
This method is used to determine the approximate total size of all assets needed to storethe video on the host device. The estimate will include the size of the video, subtitles andother assets such as thumbnails. The actual size of the video on the host devicemay vary based on the partition type and format of the storage.NOTE: This method requires the Media Manifest to retrieve the requested information, thereforeit 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.
- Parameters:
video
- reference to the video to be estimated.callback
- to return the video size.
-
getMediaFormatTracksAvailable
void getMediaFormatTracksAvailable(@NonNull() Video video, @NonNull() MediaDownloadable.MediaFormatListener mediaFormatListener)
An asynchronous call to retrieve the MediaFormat tracks available for a given video.The result will be given through the com.brightcove.player.offline.MediaDownloadable.MediaFormatListener listener.
NOTE: Only the video type DASH is currently supported.This method requires the Media Manifest to retrieve the requested information, thereforeit 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.
- Parameters:
video
- video to retrieve MediaFormatTracks from.mediaFormatListener
- callback to return MediaDownloadable
-
downloadVideo
DownloadStatus downloadVideo(@NonNull() Video video)
This method is used to request a single video to be downloaded for offline playback.Operations to initialize the download will block the UI thread. For asynchronous version use downloadVideo.
Please register a MediaDownloadable.DownloadEventListener to receive notificationswhen the download is completed, cancelled or failed.
In case the download path is not available, this method will fail by calling onDownloadFailed withthe requested video and a DownloadStatus.StatusCode = STATUS_NOT_QUEUED and DownloadStatus.ReasonCode = ERROR_DEVICE_NOT_FOUND. The same DownloadStatus instance will be returned in the method.
- Parameters:
video
- to be downloaded.
-
downloadVideo
void downloadVideo(@NonNull() Video video, @NonNull() OfflineCallback<DownloadStatus> callback)
This method is used to request a single video to be downloaded asynchronously for offlineplayback.
Please register a MediaDownloadable.DownloadEventListener to receive notificationswhen the download is completed, cancelled or failed.
In case the download path is not available, this method will fail by calling onDownloadFailed withthe requested video and a DownloadStatus.StatusCode = STATUS_NOT_QUEUED and DownloadStatus.ReasonCode = ERROR_DEVICE_NOT_FOUND. The same DownloadStatus instance will be returned in the method.- Parameters:
video
- The video to be downloaded.callback
- Provides the result of the operation.
-
cancelVideoDownload
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 versionuse cancelVideoDownload.If the video has been downloaded already, then calling this method will have no effect.Please call deleteVideo method instead to delete the video.
- Parameters:
video
- the video to be cancelled.
-
cancelVideoDownload
void cancelVideoDownload(@NonNull() Video video, @NonNull() OfflineCallback<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 method instead to delete the video.
- Parameters:
video
- The video to be cancelled.callback
- Provides the result of the operation.
-
cancelVideoDownload
boolean cancelVideoDownload(@NonNull() 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 versionuse cancelVideoDownload.If the video has been downloaded already, then calling this method will have no effect.Please call deleteVideo method instead to delete the video.
- Parameters:
videoId
- the video id.
-
cancelVideoDownload
void cancelVideoDownload(@NonNull() String videoId, @NonNull() OfflineCallback<Boolean> callback)
Asynchronously cancels a video download that has not been completed yet. If the video hasbeen downloaded already, then calling this method will have no effect.Please call deleteVideo method instead to delete the video.
- Parameters:
videoId
- The id of the video to be cancelled.callback
- Provides the result of the operation.
-
pauseVideoDownload
int pauseVideoDownload(Video video)
This method is used to pause a single video being downloaded.Operations to pause the video download will block the UI thread. For asynchronous versionuse pauseVideoDownload.
- Parameters:
video
- the video to be paused.
-
pauseVideoDownload
void pauseVideoDownload(@NonNull() Video video, @NonNull() OfflineCallback<Integer> callback)
This method is used to asynchronously pause a single video being downloaded.
- Parameters:
video
- The video to be paused.callback
- Provides the result of the operation.
-
pauseVideoDownload
int pauseVideoDownload(@NonNull() String videoId)
This method is used to pause a single video being downloaded.Operations to pause the video download will block the UI thread. For asynchronous versionuse pauseVideoDownload.
- Parameters:
videoId
- the video id.
-
pauseVideoDownload
void pauseVideoDownload(@NonNull() String videoId, @NonNull() OfflineCallback<Integer> callback)
This method is used to asynchronously pause a single video being downloaded.
- Parameters:
videoId
- The id of the video to be paused.callback
- Provides the result of the operation.
-
resumeVideoDownload
int resumeVideoDownload(@NonNull() Video video)
This method is used to resume the download of a video which was previously paused.Operations to resume the video download will block the UI thread. For asynchronous versionuse resumeVideoDownload.
- Parameters:
video
- the video to resume its download.
-
resumeVideoDownload
void resumeVideoDownload(@NonNull() Video video, @NonNull() OfflineCallback<Integer> callback)
This method is used to asynchronously resume the download of a video which was previouslypaused.
- Parameters:
video
- the video to resume its download.callback
- Provides the result of the operation.
-
resumeVideoDownload
int resumeVideoDownload(@NonNull() String videoId)
This method is used to resume a single video being downloaded which was previously paused.Operations to resume the video download will block the UI thread. For asynchronous versionuse resumeVideoDownload.
- Parameters:
videoId
- the video id.
-
resumeVideoDownload
void resumeVideoDownload(@NonNull() String videoId, @NonNull() OfflineCallback<Integer> callback)
This method is used to asynchronously resume the download of a video which was previouslypaused.
- Parameters:
videoId
- the Id of the video to resume its download.callback
- Provides the result of the operation.
-
deleteVideo
boolean deleteVideo(@NonNull() Video video)
This method can be used to remove all assets related to a single video from the host device.Deleting a video download will not cause the license to be deleted/released. Please call releaseLicense to release and remove the license.Operations to delete the video download will block the UI thread. For asynchronous versionuse deleteVideo.
- Parameters:
video
- to be deleted.
-
deleteVideo
void deleteVideo(@NonNull() Video video, @NonNull() OfflineCallback<Boolean> callback)
Asynchronously deletes the offline copy of the specified video. If the video has not beenfully downloaded yet, then it will be removed from the download queue and any partiallydownload assets belonging to the video will be deleted. The developer is responsible foreither releasing any license key set identifier attached to the video using releaseLicense or saving the license key set identifier forfuture reuse.
- Parameters:
video
- The video to be deleted.callback
- Provides the result of the operation.
-
deleteVideo
boolean deleteVideo(@NonNull() String videoId)
Deletes the offline copy of the specified video. If the video has not been fully downloadedyet, then it will be removed from the download queue and any partially download assetsbelonging to the video will be deleted. The developer is responsible for either releasingany license key set identifier attached to the video using releaseLicense or saving the license key set identifier forfuture reuse.Operations to delete the video download will block the UI thread. For asynchronous versionuse deleteVideo.
- Parameters:
videoId
- the unique identified of the video to be deleted.
-
deleteVideo
void deleteVideo(@NonNull() String videoId, @NonNull() OfflineCallback<Boolean> callback)
Asynchronously deletes the offline copy of the specified video. If the video has not beenfully downloaded yet, then it will be removed from the download queue and any partiallydownload assets belonging to the video will be deleted. The developer is responsible foreither releasing any license key set identifier attached to the video using releaseLicense or saving the license key set identifier forfuture reuse.
- Parameters:
videoId
- The Id of the video to be deleted.callback
- Provides the result of the operation.
-
getVideoDownloadStatus
DownloadStatus getVideoDownloadStatus(@NonNull() Video video)
Gets the status of previous video download request. Please note that this is a blocking call.Checking the status of large video with multiple assets may take time.Operations to retrieve the video download status will block the UI thread. For asynchronousversion use getVideoDownloadStatus.
- Parameters:
video
- the video being downloaded.
-
getVideoDownloadStatus
void getVideoDownloadStatus(@NonNull() Video video, @NonNull() OfflineCallback<DownloadStatus> callback)
Asynchronously gets the status of previous video download request. Please note that this isa blocking call. Checking the status of large video with multiple assets may take time.
- Parameters:
video
- The video which DownloadStatus will be retrieved.callback
- Provides the result of the operation.
-
getVideoDownloadStatus
@NonNull() DownloadStatus getVideoDownloadStatus(@NonNull() String videoId)
Gets the status of previous video download request. Please note that this is a blocking call.Checking the status of large video with multiple assets may take time.Operations to retrieve the video download status will block the UI thread. For asynchronousversion use getVideoDownloadStatus.
- Parameters:
videoId
- The id of the video which DownloadStatus will be retrieved.
-
getVideoDownloadStatus
void getVideoDownloadStatus(@NonNull() String videoId, @NonNull() OfflineCallback<DownloadStatus> callback)
Asynchronously gets the status of previous video download request. Please note that this isa blocking call. Checking the status of large video with multiple assets may take time.
- Parameters:
videoId
- The id of the video which DownloadStatus will be retrieved.callback
- Provides the result of the operation.
-
findAllQueuedVideoDownload
@NonNull() List<Video> findAllQueuedVideoDownload()
This method returns the list of videos that have been queued for download.The result will include all videos that have been placed in the download queue, includingthose that have been downloaded successfully. Please call getVideoDownloadStatus to find the current download status of each video.Operations to retrieve the queued videos will block the UI thread. For asynchronous versionuse findAllQueuedVideoDownload.
-
findAllQueuedVideoDownload
void findAllQueuedVideoDownload(@NonNull() OfflineCallback<List<Video>> callback)
Asynchronously returns the list of videos that have been queued for download. The result willinclude all videos that have been placed in the download queue, including those that havebeen downloaded successfully. Please call getVideoDownloadStatus to find thecurrent download status of each video.
- Parameters:
callback
- Provides the result of the operation.
-
findAllVideoDownload
@NonNull() List<Video> findAllVideoDownload(int status)
Finds all offline video downloads with specified status.Operations to retrieve all videos will block the UI thread. For asynchronous versionuse findAllVideoDownload.
- Parameters:
status
- the status of the video download.
-
findAllVideoDownload
void findAllVideoDownload(int status, @NonNull() OfflineCallback<List<Video>> callback)
Asynchronously finds all offline video downloads with specified status.
- Parameters:
status
- the status of the video download.callback
- Provides the result of the operation.
-
findOfflineVideoById
@Nullable() Video findOfflineVideoById(String videoId)
Finds the offline copy of the specified video, if it exists. Please note that a non-nullreturn value does not mean the video has been completely downloaded. Please use getVideoDownloadStatus method to determine the current status of the offlinecopy.Operations to retrieve the video will block the UI thread. For asynchronous versionuse findOfflineVideoById.
- Parameters:
videoId
- the video id.
-
findOfflineVideoById
@Nullable() Video findOfflineVideoById(String videoId, @NonNull() HttpRequestConfig httpRequestConfig)
Finds the offline copy of the specified video, if it exists. Please note that a non-nullreturn value does not mean the video has been completely downloaded. Please use getVideoDownloadStatus method to determine the current status of the offlinecopy.Operations to retrieve the video will block the UI thread. For asynchronous versionuse findOfflineVideoById.
- Parameters:
videoId
- The id of the video to retrieve.httpRequestConfig
- Http parameters when retrieving the video.
-
findOfflineVideoById
void findOfflineVideoById(String videoId, @NonNull() OfflineCallback<Video> callback)
Asynchronously finds the offline copy of the specified video, if it exists. Please note thata non-null return value does not mean the video has been completely downloaded. Please use getVideoDownloadStatus method to determine the current status of the offlinecopy.
- Parameters:
videoId
- The id of the video to retrieve.callback
- Provides the result of the operation.
-
findOfflineVideoById
void findOfflineVideoById(String videoId, @NonNull() HttpRequestConfig httpRequestConfig, @NonNull() OfflineCallback<Video> callback)
Asynchronously finds the offline copy of the specified video, if it exists. Please note thata non-null return value does not mean the video has been completely downloaded. Please use getVideoDownloadStatus method to determine the current status of the offlinecopy.
- Parameters:
videoId
- The id of the video to retrieve.httpRequestConfig
- Http parameters when retrieving the video.callback
- Provides the result of the operation.
-
requestRentalLicense
void requestRentalLicense(@NonNull() Video video, @NonNull() Date absoluteExpiration, long playDuration, @NonNull() EventListener listener)
Submits an offline playback rental license request for the specified video asynchronously.Upon successful acquisition of license, the video object will be updated to set the licensekey set identifier and actual expiration date.
- Parameters:
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 consumedafter the start of playback.listener
- reference to a listener that will be notified about the outcome of the request.
-
requestRentalLicense
void requestRentalLicense(@NonNull() Video video, @NonNull() Date absoluteExpiration, long playDuration, @NonNull() EventListener listener, @NonNull() CustomerRightsTokenConfig config)
Submits an offline playback rental license request for the specified video asynchronously.Upon successful acquisition of license, the video object will be updated to set the licensekey set identifier and actual expiration date.
- Parameters:
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 consumedafter 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 request
-
requestRentalLicense
void requestRentalLicense(@NonNull() Video video, @NonNull() Date absoluteExpiration, long playDuration, @NonNull() EventListener listener, @NonNull() HttpRequestConfig httpRequestConfig)
Submits an offline playback rental license request for the specified video asynchronously.Upon successful acquisition of license, the video object will be updated to set the licensekey set identifier and actual expiration date.
- Parameters:
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 consumedafter the start of playback.listener
- reference to a listener that will be notified about the outcome ofthe request.httpRequestConfig
- Http parameters when retrieving the video.
-
requestPurchaseLicense
void requestPurchaseLicense(@NonNull() Video video, @NonNull() EventListener listener)
Submits an offline playback purchase license request for the specified video asynchronously.Upon successful acquisition of license, the video object will be updated to set the licensekey set identifier and actual expiration date.
- Parameters:
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.
-
requestPurchaseLicense
void requestPurchaseLicense(@NonNull() Video video, @NonNull() EventListener listener, @NonNull() CustomerRightsTokenConfig config)
Submits an offline playback purchase license request for the specified video asynchronously.Upon successful acquisition of license, the video object will be updated to set the licensekey set identifier and actual expiration date.
- Parameters:
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 request
-
requestPurchaseLicense
void requestPurchaseLicense(@NonNull() Video video, @NonNull() EventListener listener, @NonNull() HttpRequestConfig httpRequestConfig)
Submits an offline playback purchase license request for the specified video asynchronously.Upon successful acquisition of license, the video object will be update to set the licensekey set identifier and actual expiration date.
- Parameters:
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.
-
releaseLicense
void releaseLicense(@NonNull() Video video, @NonNull() EventListener listener)
Submits an offline playback license release request for the specified video asynchronously. Uponsuccessful release of license, the video object will be update to remove the license key setidentifier and expiration date.
- Parameters:
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.
-
terminate
void terminate()
Terminates threads created to perform asynchronous operations. After calling thismethod the OfflineCatalog should not be used, instead a new instance of an OfflineCatalogshould be created.Calling this method will not have any effect in video downloads.
-
-
-
-