OfflineCatalog

Offline catalog is an extension of the standard catalog class that is used to fetching videos in a playlist or the details of a specific video. The offline catalog provides additional API that can be used to manage offline playback licenses and offline media.

Author

Sergio Martinez - smartinez@brightcove.com

Constructors

Link copied to clipboard
constructor(context: Context, eventEmitter: EventEmitter, account: String)
constructor(context: Context, eventEmitter: EventEmitter, account: String, policy: String)
constructor(context: Context, eventEmitter: EventEmitter, account: String, policy: String, baseURL: String)
constructor(context: Context, eventEmitter: EventEmitter, account: String, policy: String, baseURL: String, downloadFileCreator: DownloadFileCreator)

Types

Link copied to clipboard
open class Builder : AbstractOfflineCatalog.Builder<T>
The Builder to create the OfflineCatalog object.

Functions

Link copied to clipboard
Adds the specified to the list of listeners that will be notified when a download event is raised.
Link copied to clipboard
open fun cancelVideoDownload(video: Video): Boolean
open fun cancelVideoDownload(videoId: String): Boolean
Cancels a video download that has not been completed yet.
open fun cancelVideoDownload(video: Video, callback: OfflineCallback<Boolean>)
open fun cancelVideoDownload(videoId: String, callback: OfflineCallback<Boolean>)
Asynchronously cancels a video download that has not been completed yet.
Link copied to clipboard
open fun deleteVideo(video: Video): Boolean
This method can be used to remove all assets related to a single video from the host device.
open fun deleteVideo(videoId: String): Boolean
Deletes the offline copy of the specified video.
open fun deleteVideo(video: Video, callback: OfflineCallback<Boolean>)
open fun deleteVideo(videoId: String, callback: OfflineCallback<Boolean>)
Asynchronously deletes the offline copy of the specified video.
Link copied to clipboard
open fun downloadVideo(video: Video): DownloadStatus
This method is used to request a single video to be downloaded for offline playback.
open fun downloadVideo(video: Video, callback: OfflineCallback<DownloadStatus>)
This method is used to request a single video to be downloaded asynchronously for offline playback.
Link copied to clipboard
open fun estimateSize(video: Video): Long
This method returns the approximate total size for a Video already downloaded or with a download in progress.
open fun estimateSize(video: Video, callback: MediaDownloadable.OnVideoSizeCallback)
This method is used to determine the approximate total size of all assets needed to store the video on the host device.
Link copied to clipboard
open fun findAllQueuedVideoDownload(): List<Video>
This method returns the list of videos that have been queued for download.
open fun findAllQueuedVideoDownload(callback: OfflineCallback<List<Video>>)
Asynchronously returns the list of videos that have been queued for download.
Link copied to clipboard
open fun findAllVideoDownload(status: Int): List<Video>
Finds all offline video downloads with specified status.
open fun findAllVideoDownload(status: Int, callback: OfflineCallback<List<Video>>)
Asynchronously finds all offline video downloads with specified status.
Link copied to clipboard
open fun findOfflineVideoById(videoId: String): Video
open fun findOfflineVideoById(videoId: String, httpRequestConfig: HttpRequestConfig): Video
Finds the offline copy of the specified video, if it exists.
open fun findOfflineVideoById(videoId: String, callback: OfflineCallback<Video>)
open fun findOfflineVideoById(videoId: String, httpRequestConfig: HttpRequestConfig, callback: OfflineCallback<Video>)
Asynchronously finds the offline copy of the specified video, if it exists.
Link copied to clipboard
open fun getDownloadPath(): File
Gets the current base path that will be used to store new offline video requests.
Link copied to clipboard
open fun getMediaFormatTracksAvailable(video: Video, mediaFormatListener: MediaDownloadable.MediaFormatListener)
An asynchronous call to retrieve the MediaFormat tracks available for a given video.
Link copied to clipboard
This method returns a String with the representation of a size in decimal base (which is the standard when representing storage related values).
Link copied to clipboard
open fun getVideoDownloadStatus(video: Video): DownloadStatus
Gets the status of previous video download request.
open fun getVideoDownloadStatus(video: Video, callback: OfflineCallback<DownloadStatus>)
Asynchronously gets the status of previous video download request.
Link copied to clipboard
Checks whether the download path is valid.
Link copied to clipboard
Returns whether download over a metered network is allowed.
Link copied to clipboard
This method can be used to check if the SDK is currently configured to use a cellular network for downloading DRM media assets.
Link copied to clipboard
This method can be used to check if the SDK is currently configured to use a cellular roaming network for downloading DRM media assets.
Link copied to clipboard
open fun isVideoDownloadable(video: Video): Boolean
Checks if the video parameter can be downloaded and the directory to store the downloaded video files is valid.
Link copied to clipboard
open fun pauseVideoDownload(video: Video): Int
open fun pauseVideoDownload(videoId: String): Int
This method is used to pause a single video being downloaded.
open fun pauseVideoDownload(video: Video, callback: OfflineCallback<Integer>)
open fun pauseVideoDownload(videoId: String, callback: OfflineCallback<Integer>)
This method is used to asynchronously pause a single video being downloaded.
Link copied to clipboard
open fun releaseLicense(video: Video, listener: EventListener)
Submits an offline playback license release request for the specified video asynchronously.
Link copied to clipboard
Removes the specified from the list of listeners that will be notified when a download event is raised.
Link copied to clipboard
open fun requestPurchaseLicense(video: Video, listener: EventListener)
open fun requestPurchaseLicense(video: Video, listener: EventListener, config: CustomerRightsTokenConfig)
open fun requestPurchaseLicense(video: Video, listener: EventListener, httpRequestConfig: HttpRequestConfig)
Submits an offline playback purchase license request for the specified video asynchronously.
Link copied to clipboard
open fun requestRentalLicense(video: Video, absoluteExpiration: Date, playDuration: Long, listener: EventListener)
open fun requestRentalLicense(video: Video, absoluteExpiration: Date, playDuration: Long, listener: EventListener, config: CustomerRightsTokenConfig)
open fun requestRentalLicense(video: Video, absoluteExpiration: Date, playDuration: Long, listener: EventListener, httpRequestConfig: HttpRequestConfig)
Submits an offline playback rental license request for the specified video asynchronously.
Link copied to clipboard
open fun resumeVideoDownload(video: Video): Int
This method is used to resume the download of a video which was previously paused.
open fun resumeVideoDownload(videoId: String): Int
This method is used to resume a single video being downloaded which was previously paused.
open fun resumeVideoDownload(video: Video, callback: OfflineCallback<Integer>)
open fun resumeVideoDownload(videoId: String, callback: OfflineCallback<Integer>)
This method is used to asynchronously resume the download of a video which was previously paused.
Link copied to clipboard
open fun setDownloadPath(downloadFileCreator: DownloadFileCreator)
Sets the DownloadFileCreator to retrieve the base path that must be used to store new offline video requests.
open fun setDownloadPath(downloadPath: File)
Sets the base path that must be used to store new offline video requests.
Link copied to clipboard
open fun setMeteredDownloadAllowed(meteredDownloadAllowed: Boolean)
Sets whether download over a metered network is allowed.
Link copied to clipboard
open fun setMobileDownloadAllowed(mobileDownloadAllowed: Boolean)
This method can be used to configure the SDK whether the cellular network may be used to download DRM media assets or not.
Link copied to clipboard
open fun setRoamingDownloadAllowed(roamingDownloadAllowed: Boolean)
This method can be used to configure the SDK whether the cellular roaming network may be used downloading DRM media assets.
Link copied to clipboard
open fun setVideoBitrate(videoBitrate: Int)
Sets the video bitrate cap which will be used to determine what rendition will be downloaded.
Link copied to clipboard
open fun terminate()
Terminates threads created to perform asynchronous operations.