Type: Object
serviceUrl
string? The Kaltura API server.requestMethod
string? The http method to be used for sending the beacons, GET or POST, the default is GET.viewEventCountdown
number? The interval in seconds that VIEW event will be sent.resetSessionCountdown
number? The interval in seconds that Kava session will be reset.dvrThreshold
number? Threshold in seconds from the live edge.applicationVersion
string? Used to send the application version from which the user is playing the entry.playbackContext
string? Used to send the id of the category from which the user is playing the entry.tamperAnalyticsHandler
Function? An optional handler to implement. Can be used to manipulate the model data before analytics event sent, or to cancel a certain analytics request.customVar1
Object? Custom objects field.customVar2
Object? Custom objects field.customVar3
Object? Custom objects field.userId
string? custom user id .persistentSessionId
string? UUID for anonymous users.
// Default config
{
serviceUrl: '//analytics.kaltura.com/api_v3/index.php',
requestMethod: 'GET',
viewEventCountdown: 30,
resetSessionCountdown: 30,
dvrThreshold: 120,
applicationVersion: '',
playbackContext: ''
}
model
Object Event model
tamperAnalyticsHandler: function (model) {
// Always add myCustomFlag but don't send the request if the event type equals to 2
model.myCustomFlag = true;
if (model.eventType !== 2) {
return true;
}
return false;
}
Returns boolean Should send the request or not.
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Kaltura Advanced Analytics plugin.
name
string The plugin name.player
Player The player instance.config
KavaConfigObject The plugin config.
Destroys the plugin.
Returns void
Reset the plugin.
Returns void
loadMedia of the plugin.
Returns void
Gets the model object for a certain event.
event
string Event name.
const kava = player.plugins.kava;
const viewModel = kava.getEventModel(kava.EventType.VIEW);
kava.sendAnalytics(viewModel);
Returns Object Model object.
Returns KavaEventType The kava events list.
Sends KAVA analytics event to analytics service.
model
Object Event model.
player.plugins.kava.sendAnalytics({...})
.then(() => {
console.log('kava analytics sent successfully');
})
.catch(e => {
console.log('kava analytics send failed', e);
});
Returns Promise Promise to indicate request succeed or failed.
Default config of the plugin.
Type: Object
Returns boolean Whether the plugin is valid in the current environment.