Skip to main content

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

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.
public struct LuraOfflineConfiguration : Codable {
public var resolution: LuraPlayerSDK.LuraOfflineVideoResolution
public var playWhenAvailable: Bool
}

LuraOfflineVideo

ParameterTypeDescription
resolutionLuraOfflineVideoResolutionResolution of video rendition
assetIdString!Asset id
progressDouble?Downloading progress in percentage
totalUInt64?Total size in bytes
bytesUInt64?Downloaded bytes
licenseLuraOfflineVideoLicense?Video DRM Information
stateLuraDownloadingState?Downloading state
startTimeMsDouble?The first time when download entry is created.
updateTimeMsDouble?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

ParameterTypeDescription
widthIntResolution width
heightIntResolution 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

ParameterTypeDescription
licenseExpirationDateDouble?License expiration duration in seconds
totalPlaybackDurationDouble?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

ParameterTypeDescription
typeLuraOfflineEventType?Event type
dataLuraOfflineEventData?Data for current type
public struct LuraOfflineBundle  {
public var event : LuraOfflineEventType?
public var data : LuraOfflineEventData?
}

LuraOfflineEventDataSingle

ParameterTypeDescription
videoLuraOfflineVideo?Offline video object
public struct LuraOfflineEventDataSingle : LuraOfflineEventData {
public let video: LuraOfflineVideo?
}

LuraOfflineEventDataMultiple

ParameterTypeDescription
videosArray[LuraOfflineVideo]List of offline video objects
public struct LuraOfflineEventDataMultiple : LuraOfflineEventData {
public let videos: [LuraOfflineVideo]
}

LuraOfflineEventDataError

ParameterTypeDescription
videoLuraOfflineVideoOffline video object
errorStringError
messageStringMessage
public struct LuraOfflineEventDataError : LuraOfflineEventData {
public let video: LuraOfflineVideo
public let errorCode: String
public let message: String
}

LuraOfflineEventDataWarning

ParameterTypeDescription
videoLuraOfflineVideo?Offline video object
typeLuraOfflineWarningTypeType of warning
messageStringWarning description message
public struct LuraOfflineEventDataWarning : LuraOfflineEventData {
public let video: LuraOfflineVideo?
public let type: LuraOfflineWarningType
public let message: String
}