Initialization Configuration
During initialization, parameters such as autoplay, muted, volume, and loop attributes can be configured. However, it is also possible to modify the volume and muted attributes at a later time, as per requirements.
Media Initialization Configuration
The initialization configuration can set preferred video, caption, and audio behavior when playback starts.
These preferences are applied on supported platforms.
| Attribute | Type | Description |
|---|---|---|
| video | object | Initial ABR, bitrate, and latency settings. |
| caption | object | Initial caption display, language, and source settings. |
| audio | object | Initial audio language settings. |
val luraConfiguration = LuraConfiguration(
initialization = LuraInitializationConfiguration(
video = LuraVideoInitializationConfiguration(
abrEnabled = true,
preferredBitrate = 1000000L,
latencyMode = LatencyModes.DEFAULT
),
caption = LuraCaptionInitializationConfiguration(
enabled = true,
preferredLanguage = "en",
source = listOf("manifest", "embedded")
),
audio = LuraAudioInitializationConfiguration(
preferredLanguage = "en"
)
)
)
playerView = findViewById(R.id.lura_player_view)
player = LuraPlayer(context = this, playerView = playerView)
player.setConfig(luraConfiguration)
| Attribute | Type | Description |
|---|---|---|
initialization.video.abrEnabled | Boolean | Enables or disables ABR on supported platforms. |
initialization.video.preferredBitrate | Long | Preferred starting bitrate on supported platforms. |
initialization.video.latencyMode | LatencyMode | Preferred latency mode on initialization. |
initialization.caption.enabled | Boolean | Shows or hides captions on initialization. |
initialization.caption.preferredLanguage | String | Preferred caption language on supported platforms. |
initialization.caption.source | List<String> | Caption sources to use. Defaults to ["manifest", "embedded"]. |
initialization.audio.preferredLanguage | String | Preferred audio language on supported platforms. |
Autoplay Configuration
The implementation of autoplay attribute can be done in Lura Player using the following configuration.
| Attribute | Type | Description |
|---|---|---|
autoplay | Boolean | Autoplay attribute of the player. Defaults to false |
val luraConfiguration = LuraConfiguration(
controls = LuraControlsConfiguration(
autoplay = true
)
)
playerView = findViewById(R.id.lura_player_view)
player = LuraPlayer(context = this, playerView = playerView)
player.setConfig(luraConfiguration)
Mute Configuration
The implementation of initially muted attribute can be done in Lura Player using the following configuration.
| Attribute | Type | Description |
|---|---|---|
muted | Boolean | Whether to start muted when the player autoplays. Defaults to false. |
val luraConfiguration = LuraConfiguration(
controls = LuraControlsConfiguration(
muted = true
)
)
playerView = findViewById(R.id.lura_player_view)
player = LuraPlayer(context = this, playerView = playerView)
player.setConfig(luraConfiguration)
Volume Configuration
The implementation of initial volume attribute can be done in Lura Player using the following configuration.
| Attribute | Type | Description |
|---|---|---|
volume | Double | Initial volume of the player between 0.0 and 1.0. Defaults to 1.0 |
val luraConfiguration = LuraConfiguration(
controls = LuraControlsConfiguration(
volume = 0.9
)
)
playerView = findViewById(R.id.lura_player_view)
player = LuraPlayer(context = this, playerView = playerView)
player.setConfig(luraConfiguration)
Loop Configuration
The implementation of loop attribute can be done in Lura Player using the following configuration.
| Attribute | Type | Description |
|---|---|---|
loop | Boolean | Loop the video when it ends. Defaults to false. |
val luraConfiguration = LuraConfiguration(
controls = LuraControlsConfiguration(
loop = true
)
)
playerView = findViewById(R.id.lura_player_view)
player = LuraPlayer(context = this, playerView = playerView)
player.setConfig(luraConfiguration)
val luraConfiguration = LuraConfiguration(
controls = LuraControlsConfiguration(
autoplay = true,
enabled = true,
muted = true,
volume = 0.9,
loop = true
)
)
playerView = findViewById(R.id.lura_player_view)
player = LuraPlayer(context = this, playerView = playerView)
player.setConfig(luraConfiguration)