Configuring the LuraPlayer
Configuration of the lura player is very straight forward and on point. After following the steps shown in Getting Started, you can start exploring the configuration options.
You can simply put the attributes in the following manner to your config.
{ attribute: value, attribute: value, attribute: value, ... }
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 token you configured from MCP.
Attribute | Type | Description |
---|---|---|
token | string | Token of the video from MCP |
LuraPlayer("player", {
token:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2aWQiOiI0MzY2NjIzIiwiaXNzIjoiM1FMWjdaV0JsRko1Vk16Y2pyczJPbTd3VTdEanIzNFkifQ.CruM1W3gIEyQTBTqfaY5gTdf7b_2SSNg4gj6JGOj4Mg",
});
Play video with the url flow.
Attribute | Type | Required | Description |
---|---|---|---|
url | string | Yes | Play URL of the video |
format | "hls", "dash" or "mp4" | No | Play format of the video. Sometimes, the play URL does not contain data about whether the video is HLS or DASH. In this case, the format attribute is used. |
LuraPlayer("player", {
url: "https://example.com/master.m3u8",
format: "hls",
});
You can also play videos in a playlist
Attribute | Type | Description |
---|---|---|
playlist | lura.configurations.ConfigData Array | Playlist attribute for playing multiple videos inside Player |
Adding additional attributes
Attribute | Type | Description |
---|---|---|
autoplay | boolean | Autoplay attribute of the player. Default is false (If set to true, muted attribute might be set to true on some platforms where unmuted autoplay is not supported) |
poster | string | Poster image of the content. |
muted | boolean | Whether to start muted attribute of the player. Default is false |
fairplayCertificate | string | Certificate string for FairPlay DRM |
licenseUrl | string | DRM license URL |
plugins | PLUGIN_NAME : PLUGIN_CONFIG_OBJ | Lura Player Plugins |
ui | string | User interface of the player. (To disable UI and make your own UI, enter "none") |
You can use the playground tool to try out the configurations above. With Lura Player Playground, you can quickly test configurations and discover the features of Lura Player.
LuraPlayer("player", {
token:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2aWQiOiI0MzY2NjIzIiwiaXNzIjoiM1FMWjdaV0JsRko1Vk16Y2pyczJPbTd3VTdEanIzNFkifQ.CruM1W3gIEyQTBTqfaY5gTdf7b_2SSNg4gj6JGOj4Mg",
poster: "https://picsum.photos/640/360",
autoplay: true,
muted: true,
plugins: {
ima: {
adTagUrl:
"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=[correlator]",
},
},
});