Skip to main content

Getting Started

Configuration of the Lura Player is very straight forward and on point. After following the steps shown in Importing the Lura Player, you can start exploring the configuration options.

You can simply put the attributes in the following manner to your config.

Simple Configuration for content playback

To start simple, we will start with the basic attributes to play a video. There are two ways to play a video in Lura Player.

Play video with the token flow.

This is the most simple and the recommended way of playing videos. Lura Player will configure itself based on the play configuration you have configured from MCP.

AttributeTypeDescription
tokenstringToken of the video from MCP
Swift
let playerConfig = AktaPlayerConfiguration(requiredPluginsConfigurations:  [],
playerView: self.playerView,
eventListener: self.eventListener)
self.player = try? AktaPlayerCreator.playerWith(configuration: playerConfig)
let aktaMedia = AktaMedia()
aktaMedia.token = "Your token"
aktaMedia.loadType = .token
self.player?.load(media: aktaMedia, completion: { [weak self] loaded, error in
if loaded {
self?.player?.play()
}
})

Play video with the url flow.

AttributeTypeRequiredDescription
urlstringYesPlay URL of the video
Swift
let aktaMedia = AktaMedia()
aktaMedia.mediaUrl = contentUrl
self?.player?.load(media: aktaMedia, completion: { [weak self] loaded, error in
if loaded {
self?.player?.play()
}
})

You can also play videos in a playlist

AttributeTypeDescription
playlistlura.configurations.ConfigData ArrayArray of media info objects composed of token, url and additional parameters
Swift
let aktaMedia = AktaMedia()
aktaMedia.playlist = [content1, content2, ...]
self?.player?.load(media: aktaMedia, completion: { [weak self] loaded, error in
if loaded {
self?.player?.play()
}
})