Offline Manager Events
- Kotlin
- Swift
Lura Offline Event object structure:
Value | Description |
---|---|
type LuraOfflineEventType | Event type |
data LuraOfflineEventData | Data for current event |
QUEUED
The QUEUED event is fired when download asset wait to start/resume downloading .
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.QUEUED,
data = LuraOfflineEventData.Single(video = LuraOfflineVideo())
)
let bundle = LuraOfflineBundle(
event:.QUEUED,
data: LuraOfflineEventDataSingle(video: LuraOfflineVideo())
)
PAUSED
The PAUSED event is fired when download asset was paused.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.PAUSED,
data = LuraOfflineEventData.Single(video = LuraOfflineVideo())
)
let bundle = LuraOfflineBundle(
event:.PAUSED,
data: LuraOfflineEventDataSingle(video: LuraOfflineVideo()
)
PAUSED_BY_REQUIREMENTS
The PAUSED_BY_REQUIREMENTS event is fired when download asset was paused by network requirements settings.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.QUEUED,
data = LuraOfflineEventData.Single(video = LuraOfflineVideo())
)
let bundle = LuraOfflineBundle(
event:.PAUSED_BY_REQUIREMENTS,
data: LuraOfflineEventDataSingle(video: LuraOfflineVideo())
)
STOPPED
The STOPPED event is fired when download asset stop downloading.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.STOPPED,
data = LuraOfflineEventData.Single(video = LuraOfflineVideo())
)
let bundle = LuraOfflineBundle(
event:.STOPPED,
data: LuraOfflineEventDataSingle(video: LuraOfflineVideo())
)
STARTING
The STARTING event is fired when asset preparing to downloading.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.STARTING,
data = LuraOfflineEventData.Single(video = LuraOfflineVideo())
)
let bundle = LuraOfflineBundle(
event:.STARTING,
data: LuraOfflineEventDataSingle(video: LuraOfflineVideo())
)
DOWNLOADING
The DOWNLOADING event is fired when asset downloading start/resume.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.DOWNLOADING,
data = LuraOfflineEventData.Single(video = LuraOfflineVideo())
)
let bundle = LuraOfflineBundle(
event:.DOWNLOADING,
data: LuraOfflineEventDataSingle(video: LuraOfflineVideo())
)
PROGRESS
The PROGRESS event is fired when assets downloading.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.PROGRESS,
data = LuraOfflineEventData.Multiple(videos = listOf(LuraOfflineVideo()))
)
let arrayOf = [LuraOfflineVideo(), LuraOfflineVideo()]
let bundle = LuraOfflineBundle(
event:.PROGRESS,
data: LuraOfflineEventDataMultiple(videos: arrayOf)
)
COMPLETED
The COMPLETED event is fired when asset downloaded.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.COMPLETED,
data = LuraOfflineEventData.Single(video = LuraOfflineVideo())
)
let bundle = LuraOfflineBundle(
event:.COMPLETED,
data: LuraOfflineEventDataSingle(video: LuraOfflineVideo())
)
FAILED
The FAILED event is fired when asset downloading was failed.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.FAILED,
data = LuraOfflineEventData.Error(
error = LuraException(),
video = LuraOfflineVideo()
)
)
let bundle = LuraOfflineBundle(
event:.FAILED,
data: LuraOfflineEventDataError(
video: LuraOfflineVideo(),
errorCode: "500",
message: "OFFLINE FAILED"
)
)
REMOVING
The REMOVING event is fired when downloading start removing/canceling.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.REMOVING,
data = LuraOfflineEventData.Single(video = LuraOfflineVideo())
)
let bundle = LuraOfflineBundle(
event:.REMOVING,
data: LuraOfflineEventDataSingle(video: LuraOfflineVideo())
)
REMOVING_ALL
The REMOVING_ALL event is fired when all downloading start removing/canceling.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.REMOVING_ALL,
data = LuraOfflineEventData.Multiple(videos = listOf(LuraOfflineVideo()))
)
let arrayOf = [LuraOfflineVideo(), LuraOfflineVideo()]
let bundle = LuraOfflineBundle(
event:.REMOVING_ALL,
data: LuraOfflineEventDataMultiple(videos: arrayOf)
)
REMOVED
The REMOVED event is fired when downloading removed/canceled.- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.REMOVED,
data = LuraOfflineEventData.Single(video = LuraOfflineVideo())
)
let bundle = LuraOfflineBundle(
event:.REMOVED,
data: LuraOfflineEventDataSingle(video: LuraOfflineVideo())
)
RESUMED_ALL
The RESUMED_ALL event is fired when all downloading resumed.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.RESUMED_ALL,
data = LuraOfflineEventData.Multiple(videos = listOf(LuraOfflineVideo()))
)
let arrayOf = [LuraOfflineVideo(), LuraOfflineVideo()]
let bundle = LuraOfflineBundle(
event:.RESUMED_ALL,
data: LuraOfflineEventDataMultiple(videos: arrayOf)
)
PAUSED_ALL
The PAUSED_ALL event is fired when all downloading paused.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.PAUSED_ALL,
data = LuraOfflineEventData.Multiple(videos = listOf(LuraOfflineVideo()))
)
let arrayOf = [LuraOfflineVideo(), LuraOfflineVideo()]
let bundle = LuraOfflineBundle(
event:.PAUSED_ALL,
data: LuraOfflineEventDataMultiple(videos: arrayOf)
)
RESTARTING
The RESTARTING event is fired when downloading restarting.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.RESTARTING,
data = LuraOfflineEventData.Single(video = LuraOfflineVideo())
)
let bundle = LuraOfflineBundle(
event:.RESTARTING,
data: LuraOfflineEventDataSingle(video: LuraOfflineVideo())
)
LICENSE_UPDATING
The LICENSE_UPDATING event is fired when DRM license start updating.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.LICENSE_UPDATING,
data = LuraOfflineEventData.Single(video = LuraOfflineVideo())
)
let bundle = LuraOfflineBundle(
event:.LICENSE_UPDATING,
data: LuraOfflineEventDataSingle(video: LuraOfflineVideo())
)
LICENSE_UPDATED
The LICENSE_UPDATED event is fired when DRM license updated.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.LICENSE_UPDATED,
data = LuraOfflineEventData.Single(video = LuraOfflineVideo())
)
let bundle = LuraOfflineBundle(
event:.LICENSE_UPDATED,
data: LuraOfflineEventDataSingle(video: LuraOfflineVideo())
)
LICENSE_UPDATING_FAILED
The LICENSE_UPDATING_FAILED event is fired when updating DRM license was failed.
- Kotlin
- Swift
LuraOfflineEvent(
type = LuraOfflineEventType.LICENSE_UPDATING_FAILED,
data = LuraOfflineEventData.Error(
error = LuraException(),
video = LuraOfflineVideo()
)
)
let bundle = LuraOfflineBundle(
event:.LICENSE_UPDATING_FAILED,
data: LuraOfflineEventDataError(
video: LuraOfflineVideo(),
errorCode: "501",
message: "OFFLINE LICENSE_UPDATING_FAILED"
)
)