Skip to content

Latest commit

 

History

History
309 lines (221 loc) · 6.13 KB

configuration-api.md

File metadata and controls

309 lines (221 loc) · 6.13 KB

Table of Contents

KavaConfigObject

Type: Object

Properties

  • 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.

Examples

// Default config
{
 serviceUrl: '//analytics.kaltura.com/api_v3/index.php',
 requestMethod: 'GET',
 viewEventCountdown: 30,
 resetSessionCountdown: 30,
 dvrThreshold: 120,
 applicationVersion: '',
 playbackContext: ''
}

tamperAnalyticsHandler

Parameters

Examples

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.

KavaEventType

VIEW

Type: string

IMPRESSION

Type: string

PLAY_REQUEST

Type: string

PLAY

Type: string

RESUME

Type: string

PAUSE

Type: string

BUFFER_START

Type: string

BUFFER_END

Type: string

REPLAY

Type: string

SEEK

Type: string

PLAY_REACHED_25_PERCENT

Type: string

PLAY_REACHED_50_PERCENT

Type: string

PLAY_REACHED_75_PERCENT

Type: string

PLAY_REACHED_100_PERCENT

Type: string

SOURCE_SELECTED

Type: string

AUDIO_SELECTED

Type: string

FLAVOR_SWITCH

Type: string

CAPTIONS

Type: string

ERROR

Type: string

Kava

Kaltura Advanced Analytics plugin.

Parameters

destroy

Destroys the plugin.

Returns void

reset

Reset the plugin.

Returns void

loadMedia

loadMedia of the plugin.

Returns void

getEventModel

Gets the model object for a certain event.

Parameters

Examples

const kava = player.plugins.kava;
const viewModel = kava.getEventModel(kava.EventType.VIEW);
kava.sendAnalytics(viewModel);

Returns Object Model object.

EventType

Returns KavaEventType The kava events list.

sendAnalytics

Sends KAVA analytics event to analytics service.

Parameters

Examples

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.

defaultConfig

Default config of the plugin.

Type: Object

isValid

Returns boolean Whether the plugin is valid in the current environment.