Skip to main content

Quick Start

Lura Player is a video player SDK that enables HLS video playback in iOS and iPadOS applications. It has a user-friendly interface, developer-friendly SDK and includes industry standard capabilities, making it a comprehensive solution for video streaming and advertising. The SDK is written in Swift, a programming language developed by Apple for general-purpose use. Lura Player offers advanced advertisement support and a range of features for a seamless viewing experience, including support for multiple audio and subtitle tracks and advanced playback controls.

Integrating Lura Player to your existing application is easy and flawless. Just copy the following code into your ViewController once you have imported the SDK.

AttributeTypeDescription
appKeystringAppKey generated in MCP based on the pre-adjusted play configuration
assetIdstringAssetId of the VOD or the Live Stream

Define Listener

Swift
private lazy var luraListener: LuraEventListener = { [weak self] eventBundle in
switch eventBundle.type {
//Listen events Here
}
}

In order to use the LuraPlayer, include LuraPlayerView in your layout:

Init SDK and play

Swift
class PlayerController : UIViewController {

@IBOutlet weak var playerView: LuraPlayerView!

var listenerId: String? = nil
var luraPlayer: LuraPlayer?

var myAppKey: String = "appKey"
var myAssetId: String = "assetId"
let luraConfig = LuraPlayerConfiguration(lura: Lura(appKey: myAppKey, assetId: myAssetId))
private lazy var luraListener: LuraEventListener = { [weak self] eventBundle in
switch eventBundle.type {
//Listen events Here
}
}

private var playerListenerId: String? = nil

override func viewDidLoad() {
super.viewDidLoad()
self.luraPlayer = try? LuraPlayer(playerView: self.playerView, playerViewController: self)
self.playerListenerId = self.luraPlayer?.addListener(listener: self.luraListener)
self.luraPlayer?.setConfig(luraConfig)
}

}