Player configuration parameters are provided whenever a player instance is created.
var config = {
// Configuration here
};
var player = KalturaPlayer.setup(config);
The configuration uses the following structure:
{
targetId: string,
logLevel: string,
disableUserCache: boolean,
playback: PKPlaybackConfigObject,
sources: PKSourcesConfigObject,
playlist: KPPlaylisyObject,
plugins: PKPluginsConfigObject,
session: PKSessionConfigObject,
provider: ProviderOptionsObject,
ui: UIOptionsObject,
cast: CastConfigObject
}
Possible values:
"DEBUG", "INFO", "TIME", "WARN", "ERROR", "OFF"
You can learn more about user preferences in the player here.
Type: PKPlaybackConfigObject
Type: PKSourcesConfigObject
Type: KPPlaylisyObject
Type: PKPluginsConfigObject
Type: PKSessionConfigObject
Type: ProviderOptionsObject
Type: UIOptionsObject
Type: CastConfigObject
In the player setup flow, the configuration described above (partially or in full) can be provided by a number of different sources. Each source has a priority, which determines whether the source has a greater or lesser impact on how the player is configured.
Available sources include:
- Application - This is the application that embeds the player and can be used to configures the player in-line upon instantiation.
- Server - This is a partner configuration that is saved on the server. The partner can use this configuration when configuring the player by suppling the
uiConfId
value. - Local Storage (Browser) - This is the user preferences configuration, which is saved in the local storage of the browser.
- Default Player Configuration - The default player configuration is defined internally by the player.
When the player builds its runtime configuration, it will need to know how to built the configuration correctly according to the priority of each configuration, which is as follows (#1 is highest; #4 is lowest):
- Local Storage
- Application
- Server
- Default Player Configuration
In this example, we'll use the following configuration from each source to see how that source affects the configuration:
Local Storage
{
muted: true,
audioLanguage: 'spa'
}
Application
{
muted: false,
volume: 0.7
}
Server
{
audioLanguage: 'eng';
autoplay: true;
}
Default Player Configuration
{
audioLanguage: '',
textLanguage: '',
muted: false,
volume: 1,
autoplay: false
}
The resulting runtime configuration will, therefore, be as follows:
{
audioLanguage: 'spa',
textLanguage: '',
muted: true,
volume: 0.7,
autoplay: true
}