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
Parameter | Type | Description |
---|---|---|
resolution | LuraOfflineVideoResolution | Resolution of video rendition |
playWhenAvailable | bool | true - 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
Parameter | Type | Description |
---|---|---|
resolution | LuraOfflineVideoResolution | Resolution of video rendition |
assetId | String | Asset id |
progress | Float | Downloading progress in percentage |
total | Long | Total size in bytes (if available, otherwise -1) |
bytes | Long | Downloaded bytes (if available, otherwise -1) |
license | LuraOfflineVideoLicense? | Video DRM Information |
state | LuraDownloadingState | Downloading state |
startTimeMs | Long | The first time when download entry is created. |
updateTimeMs | Long | The 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
Parameter | Type | Description |
---|---|---|
width | Int | Resolution width |
height | Int | Resolution height |
enum class LuraOfflineVideoResolution(val width: Int, val height: Int) {
SD(720, 576),
HD(1280, 720),
FullHD(1920, 1080),
UltraHD(3840, 2160);
}
LuraOfflineVideoLicense
Parameter | Type | Description |
---|---|---|
licenseExpirationDate | Long | License expiration duration in seconds (if available, otherwise -1) |
totalPlaybackDuration | Long | Total 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
Parameter | Type | Description |
---|---|---|
type | LuraOfflineEventType | Event type |
data | LuraOfflineEventData | Data for current type |
@Serializable
data class LuraOfflineEvent(
val type: LuraOfflineEventType,
val data: LuraOfflineEventData,
)
LuraOfflineEventData.Single
Parameter | Type | Description |
---|---|---|
video | LuraOfflineVideo | Offline video object |
@Serializable
data class Single(val video: LuraOfflineVideo) : LuraOfflineEventData()
LuraOfflineEventData.Multiple
Parameter | Type | Description |
---|---|---|
videos | List<LuraOfflineVideo> | List of offline video objects |
@Serializable
data class Multiple(val videos: List<LuraOfflineVideo>) : LuraOfflineEventData()
LuraOfflineEventData.Error
Parameter | Type | Description |
---|---|---|
video | LuraOfflineVideo | Offline video object |
error | LuraException | Error |
@Serializable
data class Error(val video: LuraOfflineVideo, val error: LuraException? = null) : LuraOfflineEventData()
LuraOfflineEventData.Warning
Parameter | Type | Description |
---|---|---|
video | LuraOfflineVideo | Offline video object |
type | LuraOfflineWarningType | Type of warning |
message | String | Warning description message |
@Serializable
data class Warning(val video: LuraOfflineVideo? = null, val type: LuraOfflineWarningType, val message: String) : LuraOfflineEventData()