Skip to main content

Offline Manager Types Reference

LuraDownloadRequirement

enum class LuraDownloadRequirement {
/**
* Requirement that the device has CELLULAR connectivity.
*/
CELLULAR,

/**
* Requirement that the device has WiFI connectivity.
*/
WIFI,

/**
* Requirement that the device has CELLULAR or WiFI connectivity.
*/
ANY,
}

LuraOfflineConfiguration

ParameterTypeDescription
resolutionLuraOfflineVideoResolutionResolution of video rendition
playWhenAvailablebooltrue - playing from local storage if available, false - playing online if network connection is available and playing from local storage otherwise.
@Serializable
data class LuraOfflineConfiguration(
val resolution: LuraOfflineVideoResolution = LuraOfflineVideoResolution.HD,
val playWhenAvailable: Boolean = false
)

LuraOfflineVideo

ParameterTypeDescription
resolutionLuraOfflineVideoResolutionResolution of video rendition
assetIdStringAsset id
progressFloatDownloading progress in percentage
totalLongTotal size in bytes (if available, otherwise -1)
bytesLongDownloaded bytes (if available, otherwise -1)
licenseLuraOfflineVideoLicense?Video DRM Information
stateLuraDownloadingStateDownloading state
startTimeMsLongThe first time when download entry is created.
updateTimeMsLongThe last update time.
@Serializable
data class LuraOfflineVideo(
val resolution: LuraOfflineVideoResolution = LuraOfflineVideoResolution.HD,
val assetId: String = "",
val progress: Float = 0.0f,
val total: Long = -1L,
val bytes: Long = -1L,
val license: LuraOfflineVideoLicense? = null,
val state: LuraDownloadingState = LuraDownloadingState.NONE,
val startTimeMs: Long = -1L,
val updateTimeMs: Long = -1L

LuraOfflineVideoResolution

ParameterTypeDescription
widthIntResolution width
heightIntResolution height
enum class LuraOfflineVideoResolution(val width: Int, val height: Int) {
SD(720, 576),
HD(1280, 720),
FullHD(1920, 1080),
UltraHD(3840, 2160);
}

LuraOfflineVideoLicense

ParameterTypeDescription
licenseExpirationDateLongLicense expiration duration in seconds (if available, otherwise -1)
totalPlaybackDurationLongTotal playback duration in seconds (if available, otherwise -1)
@Serializable
data class LuraOfflineVideoLicense(
/**
* UNIX timestamp, license expiration (if available, otherwise -1)
*/
val licenseExpirationDate: Long = -1L,

/**
* Total playback duration in seconds (if available, otherwise -1)
*/
val totalPlaybackDuration: Long = -1L,
)

LuraDownloadingState

@Serializable
enum class LuraDownloadingState {
QUEUED,
STOPPED,
PAUSED,
PAUSED_BY_REQUIREMENTS,
DOWNLOADING,
COMPLETED,
FAILED,
REMOVING,
RESTARTING,
NONE,
}

LuraEventListener

typealias LuraOfflineEventListener = FlowCollector<LuraOfflineEvent>

LuraOfflineEvent

ParameterTypeDescription
typeLuraOfflineEventTypeEvent type
dataLuraOfflineEventDataData for current type
@Serializable
data class LuraOfflineEvent(
val type: LuraOfflineEventType,
val data: LuraOfflineEventData,
)

LuraOfflineEventData.Single

ParameterTypeDescription
videoLuraOfflineVideoOffline video object
@Serializable
data class Single(val video: LuraOfflineVideo) : LuraOfflineEventData()

LuraOfflineEventData.Multiple

ParameterTypeDescription
videosList<LuraOfflineVideo>List of offline video objects
@Serializable
data class Multiple(val videos: List<LuraOfflineVideo>) : LuraOfflineEventData()

LuraOfflineEventData.Error

ParameterTypeDescription
videoLuraOfflineVideoOffline video object
errorLuraExceptionError
@Serializable
data class Error(val video: LuraOfflineVideo, val error: LuraException? = null) : LuraOfflineEventData()

LuraOfflineEventData.Warning

ParameterTypeDescription
videoLuraOfflineVideoOffline video object
typeLuraOfflineWarningTypeType of warning
messageStringWarning description message
@Serializable
data class Warning(val video: LuraOfflineVideo? = null, val type: LuraOfflineWarningType, val message: String) : LuraOfflineEventData()