OfflineContentManager

OfflineContentManager

interface OfflineContentManager : EventEmitter<OfflineEvent>

Provides the means to download and store sources locally that can be played back with a Player without an active network connection. An OfflineContentManager instance can be created via the OfflineContentManager.getOfflineContentManager function.

The OfflineContentManager emits OfflineEvents during its lifecycle. See EventEmitter on how to subscribe to events.

Note: When downloading content for offline playback, the player license key must be provided via the via a tag in the AndroidManifest.xml using the android:name="BITMOVIN_PLAYER_LICENSE_KEY" attribute. Supplying the key only through com.bitmovin.player.api.PlayerConfig is not sufficient for downloading offline content. For offline playback (i.e., playing already downloaded content), the key from com.bitmovin.player.api.PlayerConfig can be used.

Types

NameSummary
Companionobject Companion

Properties

NameSummary
offlineSourceConfigabstract val offlineSourceConfig: OfflineSourceConfig?
Creates an OfflineSourceConfig, which can be used to play the offline content with a Player or returns null, if no offline content is available.
remainingOfflineLicenseDurationabstract val remainingOfflineLicenseDuration: DrmLicenseInformation
A DrmLicenseInformation object containing the remaining drm license duration and the remaining playback duration. Throws an IOException if the loading of the DRM key fails. Throws an UnsupportedDrmException if the provided DRM technology is not supported. Throws a DrmSessionException if the DRM licensing call to the server fails
usedStorageabstract val usedStorage: Long
Returns how many bytes of storage are used by the offline content.

Functions

NameSummary
deleteAllabstract fun deleteAll()
Deletes everything related to the related content ID.
downloadLicenseabstract fun downloadLicense()
Downloads the offline license. When finished successfully OfflineContentManagerListener.onDrmLicenseUpdated will be called. Errors are transmitted by a OfflineContentManagerListener.onError call and an OfflineEvent.Error event.
getOptionsabstract fun getOptions()
Loads the current OfflineContentOptions and passes them to OfflineContentManagerListener.onOptionsAvailable.
processabstract fun process(offlineContentOptions: OfflineContentOptions)
Enqueues downloads and deletions according to the current OfflineOptionEntryState and OfflineOptionEntryAction of the OfflineOptionEntry in the OfflineContentOptions.
releaseabstract fun release()
Releases the memory resources. IMPORTANT: Call this when the Activity/Context, in which it was created, is destroy. The OfflineContentManager should not be used after calling this method.
releaseLicenseabstract fun releaseLicense()
Releases the currently held offline license. When finished successfully OfflineContentManagerListener.onDrmLicenseUpdated will be called. Errors are transmitted by a OfflineContentManagerListener.onError call and an OfflineEvent.Error event.
renewOfflineLicenseabstract fun renewOfflineLicense()
Renews the already downloaded DRM license. When successfully finished OfflineContentManagerListener.onDrmLicenseUpdated will be called. Errors are transmitted by a OfflineContentManagerListener.onError call and an OfflineEvent.Error event.
resumeabstract fun resume()
Resumes all suspended actions.
suspendabstract fun suspend()
Suspends all active actions.