Getting Started
Configuration of the Lura Player is very straight forward and on point.
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.
Lura configuration for content playback
This is the most simple way of playing videos. Lura Player will configure itself based on the play configuration you have configured from MCP. To see more details, check out Lura Configuration
Attribute | Type | Description |
---|---|---|
appKey | String | AppKey generated in MCP based on the pre-adjusted play configuration |
token | String | (Optional) When specified the provided token will be used in entitlements requests. |
assetId | String | AssetId of the VOD or the Live Stream |
AppKey Flow
val luraConfiguration = LuraConfiguration(
lura = Lura(
appKey = "<YOUR_APP_KEY>",
assetId = "<ASSET_ID>"
)
)
playerView = findViewById(R.id.lura_player_view)
player = LuraPlayer(context = this, playerView = playerView)
player.setConfig(luraConfiguration)
Token Flow
val luraConfiguration = LuraConfiguration(
lura = Lura(
token = "<OPTIONAL_TOKEN>",
)
)
playerView = findViewById(R.id.lura_player_view)
player = LuraPlayer(context = this, playerView = playerView)
player.setConfig(luraConfiguration)
Manual media configuration for content playback
To manually configure the media, you need to add following media objects and attributes based on your needs.
- Media source
- DRM configuration
- Caption source
- Poster image source
- Trick play image source
- Title configuration
- Description configuration
- Start at configuration
- Annotations configuration
Here is an example code to play a media with all features.
Single media example
val luraConfiguration = LuraConfiguration(
name = "Lura",
content = LuraContent(
media = listOf(
LuraMedia(
type = "video/x-mpegurl",
url = ""
)
),
id = "id",
title = "title",
type = LuraVideoType.VOD
),
controls = LuraControlsConfiguration(
autoplay = false,
muted = false,
enabled = true,
volume = 0.5
),
ads = LuraAdsConfiguration(
),
plugins = LuraPluginsConfigurations(
conviva = ConvivaConfiguration(
customerKey = "",
gatewayUrl = "",
viewerId = ""
),
pal = PalConfiguration(
ppid = "",
descriptionURL = ""
),
openMeasurement = OpenMeasurementConfiguration(
friendlyViews = mutableListOf()
),
adobeMediaAnalytics = AdobeMediaAnalyticsConfiguration(
adobeAppId = ""
)
)
)
playerView = findViewById(R.id.lura_player_view)
player = LuraPlayer(context = this, playerView = playerView)
player.setConfig(luraConfiguration)