-
Notifications
You must be signed in to change notification settings - Fork 1
/
kava-config.js
54 lines (52 loc) · 2.02 KB
/
kava-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// @flow
/**
* @typedef {Object} KavaConfigObject
* @property {string} [serviceUrl] - The Kaltura API server.
* @property {number} [viewEventCountdown] - The interval in seconds that VIEW event will be sent.
* @property {number} [resetSessionCountdown] - The interval in seconds that Kava session will be reset.
* @property {number} [dvrThreshold] - Threshold in seconds from the live edge.
* @property {string} [applicationVersion] - Used to send the application version from which the user is playing the entry.
* @property {string} [playbackContext] - Used to send the id of the category from which the user is playing the entry.
* @property {Function} [tamperAnalyticsHandler] - An optional handler to implement. Can be used to manipulate the model data before analytics event sent, or to cancel a certain analytics request.
* @property {Object} [customVar1] - Custom objects field.
* @property {Object} [customVar2] - Custom objects field.
* @property {Object} [customVar3] - Custom objects field.
* @example
* // Default config
* {
* serviceUrl: '//analytics.kaltura.com/api_v3/index.php',
* viewEventCountdown: 30,
* resetSessionCountdown: 30,
* dvrThreshold: 120,
* applicationVersion: '',
* playbackContext: ''
* }
*/
type _KavaConfigObject = {
serviceUrl?: string,
viewEventCountdown?: number,
resetSessionCountdown?: number,
dvrThreshold?: number,
customVar1?: Object,
customVar2?: Object,
customVar3?: Object,
applicationVersion?: string,
playbackContext?: string,
tamperAnalyticsHandler?: Function
};
/**
* @function tamperAnalyticsHandler
* @param {Object} model - Event model
* @memberof KavaConfigObject
* @returns {boolean} - Should send the request or not.
* @example
* 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;
* }
*/
declare type KavaConfigObject = _KavaConfigObject;