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
const config = {
...
controls: {
autoplay: true,
},
...
};
const player = new lura.Player(document.getElementById("player"));
player.setConfig(config);
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. |
info
Some platforms doesn't support unmuted autoplay. So if autoplay attribute is set to true, muted attribute will be overwritten to true in platforms that doesn't support unmuted autoplay.
Mute Example
const config = {
...
controls: {
muted: true,
},
...
};
const player = new lura.Player(document.getElementById("player"));
player.setConfig(config);
Volume Configuration
The implementation of initial volume attribute can be done in Lura Player using the following configuration.
Attribute | Type | Description |
---|---|---|
volume | number | Initial volume of the player between 0.0 and 1.0. Defaults to 1.0 |
Volume Example
const config = {
...
controls: {
volume: 1.0,
},
...
};
const player = new lura.Player(document.getElementById("player"));
player.setConfig(config);
Combined Example
const config = {
...
controls: {
autoplay: true,
muted: true,
volume: 1.0
},
...
};
const player = new lura.Player(document.getElementById("player"));
player.setConfig(config);