Initialization Configuration
During initialization, parameters such as autoplay, volume, and muted attributes can be configured. However, it is also possible to modify the volume and muted attributes at a later time, as per requirements.
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 |
Autoplay Example
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. |
Mute Example
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 |
Volume Example
val luraConfiguration = LuraConfiguration(
controls = LuraControlsConfiguration(
volume = 0.9
)
)
playerView = findViewById(R.id.lura_player_view)
player = LuraPlayer(context = this, playerView = playerView)
player.setConfig(luraConfiguration)
Combined Example
val luraConfiguration = LuraConfiguration(
controls = LuraControlsConfiguration(
autoplay = true
enabled = true
muted = true
volume = 0.9
)
)
playerView = findViewById(R.id.lura_player_view)
player = LuraPlayer(context = this, playerView = playerView)
player.setConfig(luraConfiguration)