Offline Manager Types Reference
LuraDownloadRequirement
public enum LuraDownloadRequirement : String, Codable {
/* Requirement that the device has CELLULAR connectivity. */
case CELLULAR
/* Requirement that the device has WIFI connectivity. */
case WIFI
/* Requirement that the device has CELLULAR or WIFI connectivity. */
case 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. |
public struct LuraOfflineConfiguration : Codable {
public var resolution: LuraPlayerSDK.LuraOfflineVideoResolution
public var playWhenAvailable: Bool
}
LuraOfflineVideo
Parameter | Type | Description |
---|---|---|
resolution | LuraOfflineVideoResolution | Resolution of video rendition |
assetId | String! | Asset id |
progress | Double? | Downloading progress in percentage |
total | UInt64? | Total size in bytes |
bytes | UInt64? | Downloaded bytes |
license | LuraOfflineVideoLicense? | Video DRM Information |
state | LuraDownloadingState? | Downloading state |
startTimeMs | Double? | The first time when download entry is created. |
updateTimeMs | Double? | The last update time. |
public class LuraOfflineVideo : Codable, Equatable {
public var resolution : LuraOfflineVideoResolution = .hd
public var assetId : String!
public var progress : Double?
public var total : UInt64?
public var bytes : UInt64?
public var state : LuraDownloadingState?
public var license : LuraOfflineVideoLicense?
public var startTime: Double?
public var updateTime: Double?
}
LuraOfflineVideoResolution
Parameter | Type | Description |
---|---|---|
width | Int | Resolution width |
height | Int | Resolution height |
public enum LuraOfflineVideoResolution : Codable {
case sd
case hd
case fullHd
case ultraHd
var width : Int {
switch self {
case .sd: return 720
case .hd: return 1280
case .fullHd: return 1920
case .ultraHd: return 3840
}
}
var height : Int {
switch self {
case .sd: return 480
case .hd: return 720
case .fullHd: return 1080
case .ultraHd: return 2160
}
}
}
LuraOfflineVideoLicense
Parameter | Type | Description |
---|---|---|
licenseExpirationDate | Double? | License expiration duration in seconds |
totalPlaybackDuration | Double? | Total playback duration in seconds |
public class LuraOfflineVideoLicense : Codable {
public var licenseExpirationDate : Double?
public var totalPlaybackDuration : Double?
}
LuraDownloadingState
public enum LuraDownloadingState : Codable {
case QUEUED
case STOPPED
case PAUSED
case PAUSED_BY_REQUIREMENTS
case DOWNLOADING
case COMPLETED
case FAILED
case REMOVING
case RESTARTING
case NONE
}
LuraOfflineEventListener
public typealias LuraOfflineEventListener = (LuraOfflineBundle) -> ()
LuraOfflineBundle
Parameter | Type | Description |
---|---|---|
type | LuraOfflineEventType? | Event type |
data | LuraOfflineEventData? | Data for current type |
public struct LuraOfflineBundle {
public var event : LuraOfflineEventType?
public var data : LuraOfflineEventData?
}
LuraOfflineEventDataSingle
Parameter | Type | Description |
---|---|---|
video | LuraOfflineVideo? | Offline video object |
public struct LuraOfflineEventDataSingle : LuraOfflineEventData {
public let video: LuraOfflineVideo?
}
LuraOfflineEventDataMultiple
Parameter | Type | Description |
---|---|---|
videos | Array[LuraOfflineVideo] | List of offline video objects |
public struct LuraOfflineEventDataMultiple : LuraOfflineEventData {
public let videos: [LuraOfflineVideo]
}
LuraOfflineEventDataError
Parameter | Type | Description |
---|---|---|
video | LuraOfflineVideo | Offline video object |
error | String | Error |
message | String | Message |
public struct LuraOfflineEventDataError : LuraOfflineEventData {
public let video: LuraOfflineVideo
public let errorCode: String
public let message: String
}
LuraOfflineEventDataWarning
Parameter | Type | Description |
---|---|---|
video | LuraOfflineVideo? | Offline video object |
type | LuraOfflineWarningType | Type of warning |
message | String | Warning description message |
public struct LuraOfflineEventDataWarning : LuraOfflineEventData {
public let video: LuraOfflineVideo?
public let type: LuraOfflineWarningType
public let message: String
}