Player setup requires the following steps to create a player instance:
<script src="//PATH/TO/PLAYER/LIB/FILENAME.js"></script>
<div id="player-container"></div>
var config = {
targetId: "player-container",
provider: { // provider configuration
...
partnerId: 'YOUR_PARTNER_ID',
uiConfId: 'YOUR_UICONF_ID'
...
},
playback: { ... }, // playback configuration
plugins: { ... }, // plugins configuration
ui: { ... } // ui configuration
};
The following sections are examples of common (and important) configurations for the player setup.
If you need to use a KS for your media requests, configure it inside your provider configuration:
var config = {
...
provider: {
...
partnerId: 'YOUR_PARTNER_ID',
ks: 'YOUR_KS'
...
}
...
};
See this article to learn more about how to create a KS.
If you want to use a server configuration, you’ll need to provide the uiConfId
in your provider configuration:
var config = {
...
provider: {
...
partnerId: 'YOUR_PARTNER_ID',
uiConfId: 'YOUR_UI_CONF_ID'
...
}
...
};
If you want to refer to a specific backend URL, you can specify it in your provider configuration:
var config = {
...
provider: {
...
partnerId: 'YOUR_PARTNER_ID',
env: {
serviceUrl: 'YOUR_SERVICE_URL'
}
...
}
...
};
For full configuration details see this document.
To get your player instance, use the setup
factory method and pass it your player configuration:
var player = KalturaPlayer.setup(config);
You’re now ready to start playing your video; see Playing Your Video for details.