Skip to main content

Getting Started

Configuration of the lura player is very straight forward and on point. After following the steps shown in Embedding the Lura Player, 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.

AttributeTypeDescription
tokenstringToken of the video from MCP
LuraPlayer("player", {
token:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2aWQiOiI0MzY2NjIzIiwiaXNzIjoiM1FMWjdaV0JsRko1Vk16Y2pyczJPbTd3VTdEanIzNFkifQ.CruM1W3gIEyQTBTqfaY5gTdf7b_2SSNg4gj6JGOj4Mg",
});

Play video with the url flow.

AttributeTypeRequiredDescription
urlstringYesPlay URL of the video
format"hls", "dash" or "mp4"NoPlay 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

AttributeTypeDescription
playlistlura.configurations.ConfigData ArrayArray of media info objects composed of token, url and additional parameters

Adding optional attributes

AttributeTypeDescription
autoplaybooleanAutoplay 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)
titlestringTitle of the content. (not necessary for token flow)
descriptionstringDescription of the content. (not necessary for token flow)
posterstringPoster image of the content.
mutedbooleanWhether to start muted attribute of the player. Default is false
volumenumberVolume betwen 0.0 and 1.0 (Default is 1.0)
preferredDrm("widevine" | "fairplay" | "playready")[]Preferred DRM (only if client supports that DRM)
fairplayCertificatestringCertificate string for FairPlay DRM
licenseUrlstringDRM license URL
ui"auto" | "none"UI of the Lura Player. If you want to disable the user interface, pass "none", otherwise "auto" will be used as default.
playbackSpeednumberUsed to change the playback rate of the playing video. (Default is 1.0)
pluginsPLUGIN_NAME : PLUGIN_CONFIG_OBJLura Player Plugins

Example code:

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]",
},
},
});