downloadVideo

open fun downloadVideo(video: Video): DownloadStatus

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 notifications when the download is completed, cancelled or failed.

In case the download path is not available, this method will fail by calling onDownloadFailed with the 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.

Return

DownloadStatus with the current state of the download.

Parameters

video

to be downloaded.

See also


open fun downloadVideo(video: Video, callback: OfflineCallback<DownloadStatus>)

This method is used to request a single video to be downloaded asynchronously for offline playback.

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 onDownloadFailed with the 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. In case the download of the requested video is started successfully, onSuccess will be called to provide the DownloadStatus, otherwise onFailure will be called.

See also