@srgssr/pillarbox-web 1.13.1 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pillarbox-core.cjs.js +1 -1
- package/dist/pillarbox-core.cjs.min.js +1 -1
- package/dist/pillarbox-core.es.js +1 -1
- package/dist/pillarbox-core.es.min.js +1 -1
- package/dist/pillarbox-core.umd.js +1 -1
- package/dist/pillarbox-core.umd.min.js +1 -1
- package/dist/pillarbox.cjs.js +856 -1
- package/dist/pillarbox.cjs.min.js +1 -1
- package/dist/pillarbox.cjs.min.js.map +1 -1
- package/dist/pillarbox.es.js +856 -1
- package/dist/pillarbox.es.min.js +1 -1
- package/dist/pillarbox.es.min.js.map +1 -1
- package/dist/pillarbox.umd.js +858 -3
- package/dist/pillarbox.umd.min.js +11 -11
- package/dist/pillarbox.umd.min.js.map +1 -1
- package/dist/types/src/middleware/srgssr.d.ts +9 -0
- package/dist/types/src/middleware/srgssr.d.ts.map +1 -1
- package/dist/types/src/trackers/PillarboxMonitoring.d.ts +695 -0
- package/dist/types/src/trackers/PillarboxMonitoring.d.ts.map +1 -0
- package/dist/types/src/trackers/SRGAnalytics.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/types/src/analytics/SRGAnalytics.d.ts.map +0 -1
- /package/dist/types/src/{analytics → trackers}/SRGAnalytics.d.ts +0 -0
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
export default PillarboxMonitoring;
|
|
2
|
+
/**
|
|
3
|
+
* The PillarboxMonitoring class retrieves data about media playback.
|
|
4
|
+
*
|
|
5
|
+
* This data can be used to :
|
|
6
|
+
* - help investigate playback problems
|
|
7
|
+
* - measure the quality of our service
|
|
8
|
+
*
|
|
9
|
+
* The sending of this data tries to respect as much as possible the
|
|
10
|
+
* specification described in the link below.
|
|
11
|
+
*
|
|
12
|
+
* However, some platforms may have certain limitations.
|
|
13
|
+
* In this case, only the data available will be sent.
|
|
14
|
+
*
|
|
15
|
+
* @see https://github.com/SRGSSR/pillarbox-documentation/blob/main/Specifications/monitoring.md
|
|
16
|
+
*/
|
|
17
|
+
declare class PillarboxMonitoring {
|
|
18
|
+
/**
|
|
19
|
+
* Generates a new session ID.
|
|
20
|
+
*
|
|
21
|
+
* @returns {string} random UUID
|
|
22
|
+
*/
|
|
23
|
+
static sessionId(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieve or generate a unique device ID and stores it in localStorage.
|
|
26
|
+
*
|
|
27
|
+
* @returns {string|undefined} The device ID if localStorage is available,
|
|
28
|
+
* otherwise `undefined`
|
|
29
|
+
*/
|
|
30
|
+
static deviceId(): string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Generate a cryptographically secure random UUID.
|
|
33
|
+
*
|
|
34
|
+
* @returns {string}
|
|
35
|
+
*/
|
|
36
|
+
static randomUUID(): string;
|
|
37
|
+
/**
|
|
38
|
+
* converts seconds into milliseconds.
|
|
39
|
+
*
|
|
40
|
+
* @param {number} seconds
|
|
41
|
+
*
|
|
42
|
+
* @returns {number} milliseconds as an integer value
|
|
43
|
+
*/
|
|
44
|
+
static secondsToMilliseconds(seconds: number): number;
|
|
45
|
+
/**
|
|
46
|
+
* The timestamp in milliseconds.
|
|
47
|
+
*
|
|
48
|
+
* @return {number} milliseconds as an integer value
|
|
49
|
+
*/
|
|
50
|
+
static timestamp(): number;
|
|
51
|
+
/**
|
|
52
|
+
* The browser's user agent.
|
|
53
|
+
*
|
|
54
|
+
* @returns {string}
|
|
55
|
+
*/
|
|
56
|
+
static userAgent(): string;
|
|
57
|
+
constructor(player: any, { playerName, playerVersion, platform, schemaVersion, heartbeatInterval, beaconUrl }?: {
|
|
58
|
+
playerName?: string;
|
|
59
|
+
playerVersion?: string;
|
|
60
|
+
platform?: string;
|
|
61
|
+
schemaVersion?: number;
|
|
62
|
+
heartbeatInterval?: number;
|
|
63
|
+
beaconUrl?: string;
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* @type {import('video.js/dist/types/player').default}
|
|
67
|
+
*/
|
|
68
|
+
player: import('video.js/dist/types/player').default;
|
|
69
|
+
/**
|
|
70
|
+
* @type {string}
|
|
71
|
+
*/
|
|
72
|
+
playerName: string;
|
|
73
|
+
/**
|
|
74
|
+
* @type {string}
|
|
75
|
+
*/
|
|
76
|
+
playerVersion: string;
|
|
77
|
+
/**
|
|
78
|
+
* @type {string}
|
|
79
|
+
*/
|
|
80
|
+
platform: string;
|
|
81
|
+
/**
|
|
82
|
+
* @type {string}
|
|
83
|
+
*/
|
|
84
|
+
schemaVersion: string;
|
|
85
|
+
/**
|
|
86
|
+
* @type {Number}
|
|
87
|
+
*/
|
|
88
|
+
heartbeatInterval: number;
|
|
89
|
+
/**
|
|
90
|
+
* @type {string}
|
|
91
|
+
*/
|
|
92
|
+
beaconUrl: string;
|
|
93
|
+
/**
|
|
94
|
+
* @type {string}
|
|
95
|
+
*/
|
|
96
|
+
currentSessionId: string;
|
|
97
|
+
/**
|
|
98
|
+
* @type {Number}
|
|
99
|
+
*/
|
|
100
|
+
lastPlaybackDuration: number;
|
|
101
|
+
/**
|
|
102
|
+
* @type {Number}
|
|
103
|
+
*/
|
|
104
|
+
lastPlaybackStartTimestamp: number;
|
|
105
|
+
/**
|
|
106
|
+
* @type {Number}
|
|
107
|
+
*/
|
|
108
|
+
lastStallCount: number;
|
|
109
|
+
/**
|
|
110
|
+
* @type {Number}
|
|
111
|
+
*/
|
|
112
|
+
lastStallDuration: number;
|
|
113
|
+
/**
|
|
114
|
+
* @type {Number}
|
|
115
|
+
*/
|
|
116
|
+
loadStartTimestamp: number;
|
|
117
|
+
/**
|
|
118
|
+
* @type {Number}
|
|
119
|
+
*/
|
|
120
|
+
metadataRequestTime: number;
|
|
121
|
+
/**
|
|
122
|
+
* @type {string}
|
|
123
|
+
*/
|
|
124
|
+
mediaAssetUrl: string;
|
|
125
|
+
/**
|
|
126
|
+
* @type {string}
|
|
127
|
+
*/
|
|
128
|
+
mediaId: string;
|
|
129
|
+
/**
|
|
130
|
+
* @type {string}
|
|
131
|
+
*/
|
|
132
|
+
mediaMetadataUrl: string;
|
|
133
|
+
/**
|
|
134
|
+
* @type {string}
|
|
135
|
+
*/
|
|
136
|
+
mediaOrigin: string;
|
|
137
|
+
/**
|
|
138
|
+
* @type {Number}
|
|
139
|
+
*/
|
|
140
|
+
tokenRequestTime: number;
|
|
141
|
+
/**
|
|
142
|
+
* Adds event listeners to the player and the window.
|
|
143
|
+
*/
|
|
144
|
+
addListeners(): void;
|
|
145
|
+
/**
|
|
146
|
+
* The current bandwidth of the last segment download.
|
|
147
|
+
*
|
|
148
|
+
* @returns {number|undefined} The current bandwidth in bits per second,
|
|
149
|
+
* undefined otherwise.
|
|
150
|
+
*/
|
|
151
|
+
bandwidth(): number | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* Binds the callback functions to the current instance.
|
|
154
|
+
*/
|
|
155
|
+
bindCallBacks(): void;
|
|
156
|
+
/**
|
|
157
|
+
* Handles player errors by sending an `ERROR` event, then resets the session.
|
|
158
|
+
*/
|
|
159
|
+
error(): void;
|
|
160
|
+
/**
|
|
161
|
+
* Handles the session start by sending a `START` event immediately followed
|
|
162
|
+
* by a `HEARTBEAT` when the `loadeddata` event is triggered.
|
|
163
|
+
*/
|
|
164
|
+
loadedData(): void;
|
|
165
|
+
/**
|
|
166
|
+
* Handles `loadstart` event and captures the current timestamp. Will be used
|
|
167
|
+
* to calculate the media loading time.
|
|
168
|
+
*/
|
|
169
|
+
loadStart(): void;
|
|
170
|
+
/**
|
|
171
|
+
* Assign the timestamp each time the playback starts.
|
|
172
|
+
*/
|
|
173
|
+
playbackStart(): void;
|
|
174
|
+
/**
|
|
175
|
+
* Calculates and accumulates the duration of the playback session each time
|
|
176
|
+
* the playback stops for the current media.
|
|
177
|
+
*/
|
|
178
|
+
playbackStop(): void;
|
|
179
|
+
/**
|
|
180
|
+
* Handles the stalled state of the player. Sets the stalled state and listens
|
|
181
|
+
* for the event that indicates the player is no longer stalled.
|
|
182
|
+
*/
|
|
183
|
+
stalled(): void;
|
|
184
|
+
/**
|
|
185
|
+
* Stops the current session by sending a `STOP` event and resetting the
|
|
186
|
+
* session.
|
|
187
|
+
*
|
|
188
|
+
* @param {Event} [event] The event that triggered the stop. This is passed
|
|
189
|
+
* to the reset function.
|
|
190
|
+
*/
|
|
191
|
+
sessionStop(event?: Event): void;
|
|
192
|
+
/**
|
|
193
|
+
* Get the buffer duration in milliseconds.
|
|
194
|
+
*
|
|
195
|
+
* @returns {Number} The buffer duration
|
|
196
|
+
*/
|
|
197
|
+
bufferDuration(): number;
|
|
198
|
+
/**
|
|
199
|
+
* Get the current representation when playing a Dash or Hls media.
|
|
200
|
+
*
|
|
201
|
+
* @typedef {Object} Representation
|
|
202
|
+
* @property {number|undefined} bandwidth The bandwidth of the current
|
|
203
|
+
* representation
|
|
204
|
+
* @property {number|undefined} programDateTime The program date time of the
|
|
205
|
+
* current representation
|
|
206
|
+
* @property {string|undefined} uri The URL of the current representation
|
|
207
|
+
*
|
|
208
|
+
* @returns {Representation|undefined} The current representation object
|
|
209
|
+
* undefined otherwise
|
|
210
|
+
*/
|
|
211
|
+
currentRepresentation(): {
|
|
212
|
+
/**
|
|
213
|
+
* The bandwidth of the current
|
|
214
|
+
* representation
|
|
215
|
+
*/
|
|
216
|
+
bandwidth: number | undefined;
|
|
217
|
+
/**
|
|
218
|
+
* The program date time of the
|
|
219
|
+
* current representation
|
|
220
|
+
*/
|
|
221
|
+
programDateTime: number | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* The URL of the current representation
|
|
224
|
+
*/
|
|
225
|
+
uri: string | undefined;
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Get the current resource information including bitrate and URL when available.
|
|
229
|
+
*
|
|
230
|
+
* @typedef {Object} Resource
|
|
231
|
+
* @property {number|undefined} bitrate The bitrate of the current resource
|
|
232
|
+
* @property {string|undefined} url The URL of the current resource
|
|
233
|
+
*
|
|
234
|
+
* @returns {Resource} The current resource information.
|
|
235
|
+
*/
|
|
236
|
+
currentResource(): {
|
|
237
|
+
/**
|
|
238
|
+
* The bitrate of the current resource
|
|
239
|
+
*/
|
|
240
|
+
bitrate: number | undefined;
|
|
241
|
+
/**
|
|
242
|
+
* The URL of the current resource
|
|
243
|
+
*/
|
|
244
|
+
url: string | undefined;
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* The media data of the current source.
|
|
248
|
+
*
|
|
249
|
+
* @returns {Object} The media data of the current source, or an empty object
|
|
250
|
+
* if no media data is available.
|
|
251
|
+
*/
|
|
252
|
+
currentSourceMediaData(): any;
|
|
253
|
+
/**
|
|
254
|
+
* Get the DRM license request duration from performance API.
|
|
255
|
+
*
|
|
256
|
+
* @returns {number|undefined} The request duration
|
|
257
|
+
*/
|
|
258
|
+
getDrmRequestDuration(): number | undefined;
|
|
259
|
+
/**
|
|
260
|
+
* Get metadata information from the performance API for a given id.
|
|
261
|
+
*
|
|
262
|
+
* @typedef {Object} MetadataInfo
|
|
263
|
+
* @property {string} name The URL of the resource
|
|
264
|
+
* @property {number} duration The duration of the resource fetch in milliseconds
|
|
265
|
+
*
|
|
266
|
+
* @param {string} id The id to search for in the resource entries
|
|
267
|
+
*
|
|
268
|
+
* @returns {MetadataInfo|undefined} An object containing metadata
|
|
269
|
+
* information, or undefined otherwise
|
|
270
|
+
*/
|
|
271
|
+
getMetadataInfo(id: string): {
|
|
272
|
+
/**
|
|
273
|
+
* The URL of the resource
|
|
274
|
+
*/
|
|
275
|
+
name: string;
|
|
276
|
+
/**
|
|
277
|
+
* The duration of the resource fetch in milliseconds
|
|
278
|
+
*/
|
|
279
|
+
duration: number;
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* Get the Akamai token request duration from performance API.
|
|
283
|
+
*
|
|
284
|
+
* @returns {number|undefined} The request duration
|
|
285
|
+
*/
|
|
286
|
+
getTokenRequestDuration(tokenType: any): number | undefined;
|
|
287
|
+
/**
|
|
288
|
+
* Send an 'HEARTBEAT' event with the date of the current playback state at
|
|
289
|
+
* regular intervals.
|
|
290
|
+
*/
|
|
291
|
+
heartbeat(): void;
|
|
292
|
+
heartbeatIntervalId: NodeJS.Timeout;
|
|
293
|
+
/**
|
|
294
|
+
* Check if the tracker is disabled.
|
|
295
|
+
*
|
|
296
|
+
* @returns {Boolean} __true__ if disabled __false__ otherwise.
|
|
297
|
+
*/
|
|
298
|
+
isTrackerDisabled(): boolean;
|
|
299
|
+
sessionStartTimestamp: number;
|
|
300
|
+
/**
|
|
301
|
+
* The media information.
|
|
302
|
+
*
|
|
303
|
+
* @typedef {Object} MediaInfo
|
|
304
|
+
* @property {string} asset_url The URL of the media
|
|
305
|
+
* @property {string} id The ID of the media
|
|
306
|
+
* @property {string} metadata_url The URL of the media metadata
|
|
307
|
+
* @property {string} origin The origin of the media
|
|
308
|
+
*
|
|
309
|
+
* @returns {MediaInfo} An object container the media information
|
|
310
|
+
*/
|
|
311
|
+
mediaInfo(): {
|
|
312
|
+
/**
|
|
313
|
+
* The URL of the media
|
|
314
|
+
*/
|
|
315
|
+
asset_url: string;
|
|
316
|
+
/**
|
|
317
|
+
* The ID of the media
|
|
318
|
+
*/
|
|
319
|
+
id: string;
|
|
320
|
+
/**
|
|
321
|
+
* The URL of the media metadata
|
|
322
|
+
*/
|
|
323
|
+
metadata_url: string;
|
|
324
|
+
/**
|
|
325
|
+
* The origin of the media
|
|
326
|
+
*/
|
|
327
|
+
origin: string;
|
|
328
|
+
};
|
|
329
|
+
/**
|
|
330
|
+
* The total playback duration for the current session.
|
|
331
|
+
*
|
|
332
|
+
* @returns {number} The total playback duration in milliseconds.
|
|
333
|
+
*/
|
|
334
|
+
playbackDuration(): number;
|
|
335
|
+
/**
|
|
336
|
+
* The current playback position and position timestamp.
|
|
337
|
+
*
|
|
338
|
+
* @typedef {Object} PlaybackPosition
|
|
339
|
+
* @property {number} position The current playback position in milliseconds
|
|
340
|
+
* @property {number|undefined} position_timestamp The timestamp of the
|
|
341
|
+
* current playback position, or undefined if not available
|
|
342
|
+
*
|
|
343
|
+
* @returns {PlaybackPosition} The playback position object.
|
|
344
|
+
*/
|
|
345
|
+
playbackPosition(): {
|
|
346
|
+
/**
|
|
347
|
+
* The current playback position in milliseconds
|
|
348
|
+
*/
|
|
349
|
+
position: number;
|
|
350
|
+
/**
|
|
351
|
+
* The timestamp of the
|
|
352
|
+
* current playback position, or undefined if not available
|
|
353
|
+
*/
|
|
354
|
+
position_timestamp: number | undefined;
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* The current dimensions of the player.
|
|
358
|
+
*
|
|
359
|
+
* @typedef {Object} PlayerCurrentDimensions
|
|
360
|
+
* @property {number} width The current width of the player
|
|
361
|
+
* @property {number} height The current height of the player
|
|
362
|
+
*
|
|
363
|
+
* @returns {PlayerCurrentDimensions} The current dimensions of the player object.
|
|
364
|
+
*/
|
|
365
|
+
playerCurrentDimensions(): {
|
|
366
|
+
/**
|
|
367
|
+
* The current width of the player
|
|
368
|
+
*/
|
|
369
|
+
width: number;
|
|
370
|
+
/**
|
|
371
|
+
* The current height of the player
|
|
372
|
+
*/
|
|
373
|
+
height: number;
|
|
374
|
+
};
|
|
375
|
+
/**
|
|
376
|
+
* Information about the player.
|
|
377
|
+
*
|
|
378
|
+
* @typedef {Object} PlayerInfo
|
|
379
|
+
* @property {string} name The name of the player
|
|
380
|
+
* @property {string} version The version of the player
|
|
381
|
+
* @property {string} platform The platform on which the player is running
|
|
382
|
+
*
|
|
383
|
+
* @returns {PlayerInfo} An object containing player information.
|
|
384
|
+
*/
|
|
385
|
+
playerInfo(): {
|
|
386
|
+
/**
|
|
387
|
+
* The name of the player
|
|
388
|
+
*/
|
|
389
|
+
name: string;
|
|
390
|
+
/**
|
|
391
|
+
* The version of the player
|
|
392
|
+
*/
|
|
393
|
+
version: string;
|
|
394
|
+
/**
|
|
395
|
+
* The platform on which the player is running
|
|
396
|
+
*/
|
|
397
|
+
platform: string;
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* Generates the QoE timings object.
|
|
401
|
+
*
|
|
402
|
+
* @typedef {Object} QoeTimings
|
|
403
|
+
* @property {number} metadata The time taken to load metadata
|
|
404
|
+
* @property {number} asset The time taken to load the asset
|
|
405
|
+
* @property {number} total The total time taken from session start to data load
|
|
406
|
+
*
|
|
407
|
+
* @param {number} timeToLoadedData The time taken to load the data
|
|
408
|
+
* @param {number} timestamp The current timestamp
|
|
409
|
+
*
|
|
410
|
+
* @returns {QoeTimings} The QoE timings
|
|
411
|
+
*/
|
|
412
|
+
qoeTimings(timeToLoadedData: number, timestamp: number): {
|
|
413
|
+
/**
|
|
414
|
+
* The time taken to load metadata
|
|
415
|
+
*/
|
|
416
|
+
metadata: number;
|
|
417
|
+
/**
|
|
418
|
+
* The time taken to load the asset
|
|
419
|
+
*/
|
|
420
|
+
asset: number;
|
|
421
|
+
/**
|
|
422
|
+
* The total time taken from session start to data load
|
|
423
|
+
*/
|
|
424
|
+
total: number;
|
|
425
|
+
};
|
|
426
|
+
/**
|
|
427
|
+
* Generates the QoS timings object.
|
|
428
|
+
*
|
|
429
|
+
* @typedef {Object} QosTimings
|
|
430
|
+
* @property {number} asset The time taken to load the asset
|
|
431
|
+
* @property {number} drm The time taken for DRM processing
|
|
432
|
+
* @property {number} metadata The time taken to load metadata
|
|
433
|
+
* @property {number} token The time taken to request the token
|
|
434
|
+
*
|
|
435
|
+
* @param {number} timeToLoadedData The time taken to load the data
|
|
436
|
+
*
|
|
437
|
+
* @returns {QosTimings} The QoS timings
|
|
438
|
+
*/
|
|
439
|
+
qosTimings(timeToLoadedData: number): {
|
|
440
|
+
/**
|
|
441
|
+
* The time taken to load the asset
|
|
442
|
+
*/
|
|
443
|
+
asset: number;
|
|
444
|
+
/**
|
|
445
|
+
* The time taken for DRM processing
|
|
446
|
+
*/
|
|
447
|
+
drm: number;
|
|
448
|
+
/**
|
|
449
|
+
* The time taken to load metadata
|
|
450
|
+
*/
|
|
451
|
+
metadata: number;
|
|
452
|
+
/**
|
|
453
|
+
* The time taken to request the token
|
|
454
|
+
*/
|
|
455
|
+
token: number;
|
|
456
|
+
};
|
|
457
|
+
/**
|
|
458
|
+
* Removes all event listeners from the player and the window.
|
|
459
|
+
*/
|
|
460
|
+
removeListeners(): void;
|
|
461
|
+
/**
|
|
462
|
+
* Remove the token from the asset URL.
|
|
463
|
+
*
|
|
464
|
+
* @param {string} assetUrl The URL of the asset
|
|
465
|
+
*
|
|
466
|
+
* @returns {string|undefined} The URL without the token, or undefined if the
|
|
467
|
+
* input URL is invalid
|
|
468
|
+
*/
|
|
469
|
+
removeTokenFromAssetUrl(assetUrl: string): string | undefined;
|
|
470
|
+
/**
|
|
471
|
+
* Resets the playback session and clears relevant properties.
|
|
472
|
+
*
|
|
473
|
+
* @param {Event} event The event that triggered the reset. If the event type
|
|
474
|
+
* is not 'ended' or 'playerreset', listeners will be removed.
|
|
475
|
+
*/
|
|
476
|
+
reset(event: Event): void;
|
|
477
|
+
/**
|
|
478
|
+
* Sends an event to the server using the Beacon API.
|
|
479
|
+
*
|
|
480
|
+
* @param {string} eventName Either START, STOP, ERROR, HEARTBEAT
|
|
481
|
+
* @param {Object} [data={}] The payload object to be sent. Defaults to an
|
|
482
|
+
* empty object if not provided
|
|
483
|
+
*/
|
|
484
|
+
sendEvent(eventName: string, data?: any): void;
|
|
485
|
+
/**
|
|
486
|
+
* Starts a new session by first stopping the previous session, then resetting
|
|
487
|
+
* the session start timestamp and media ID to their new values.
|
|
488
|
+
*/
|
|
489
|
+
sessionStart(): void;
|
|
490
|
+
isStalled: boolean;
|
|
491
|
+
/**
|
|
492
|
+
* Information about the player's stall events.
|
|
493
|
+
*
|
|
494
|
+
* @typedef {Object} StallInfo
|
|
495
|
+
* @property {number} count The number of stall events
|
|
496
|
+
* @property {number} duration The total duration of stall events in
|
|
497
|
+
* milliseconds
|
|
498
|
+
*
|
|
499
|
+
* @returns {StallInfo} An object containing the stall information
|
|
500
|
+
*/
|
|
501
|
+
stallInfo(): {
|
|
502
|
+
/**
|
|
503
|
+
* The number of stall events
|
|
504
|
+
*/
|
|
505
|
+
count: number;
|
|
506
|
+
/**
|
|
507
|
+
* The total duration of stall events in
|
|
508
|
+
* milliseconds
|
|
509
|
+
*/
|
|
510
|
+
duration: number;
|
|
511
|
+
};
|
|
512
|
+
/**
|
|
513
|
+
* Get data on the current playback state. Will be used when sending `HEARTBEAT` or `STOP` events.
|
|
514
|
+
*
|
|
515
|
+
* @typedef {Object} StatusEventData
|
|
516
|
+
* @property {number} bandwidth The current bandwidth
|
|
517
|
+
* @property {number|undefined} bitrate The bitrate of the current resource
|
|
518
|
+
* @property {number} buffered_duration The duration of the buffered content
|
|
519
|
+
* @property {number} frame_drops The number of dropped frames
|
|
520
|
+
* @property {number} playback_duration The duration of the playback
|
|
521
|
+
* @property {number} position The current playback position
|
|
522
|
+
* @property {number} position_timestamp The timestamp of the current playback position
|
|
523
|
+
* @property {Object} stall Information about any stalls
|
|
524
|
+
* @property {string} stream_type The type of stream, either 'on-demand' or 'live'
|
|
525
|
+
* @property {string|undefined} url The URL of the current resource
|
|
526
|
+
*
|
|
527
|
+
* @returns {StatusEventData} The current event data
|
|
528
|
+
*/
|
|
529
|
+
statusEventData(): {
|
|
530
|
+
/**
|
|
531
|
+
* The current bandwidth
|
|
532
|
+
*/
|
|
533
|
+
bandwidth: number;
|
|
534
|
+
/**
|
|
535
|
+
* The bitrate of the current resource
|
|
536
|
+
*/
|
|
537
|
+
bitrate: number | undefined;
|
|
538
|
+
/**
|
|
539
|
+
* The duration of the buffered content
|
|
540
|
+
*/
|
|
541
|
+
buffered_duration: number;
|
|
542
|
+
/**
|
|
543
|
+
* The number of dropped frames
|
|
544
|
+
*/
|
|
545
|
+
frame_drops: number;
|
|
546
|
+
/**
|
|
547
|
+
* The duration of the playback
|
|
548
|
+
*/
|
|
549
|
+
playback_duration: number;
|
|
550
|
+
/**
|
|
551
|
+
* The current playback position
|
|
552
|
+
*/
|
|
553
|
+
position: number;
|
|
554
|
+
/**
|
|
555
|
+
* The timestamp of the current playback position
|
|
556
|
+
*/
|
|
557
|
+
position_timestamp: number;
|
|
558
|
+
/**
|
|
559
|
+
* Information about any stalls
|
|
560
|
+
*/
|
|
561
|
+
stall: any;
|
|
562
|
+
/**
|
|
563
|
+
* The type of stream, either 'on-demand' or 'live'
|
|
564
|
+
*/
|
|
565
|
+
stream_type: string;
|
|
566
|
+
/**
|
|
567
|
+
* The URL of the current resource
|
|
568
|
+
*/
|
|
569
|
+
url: string | undefined;
|
|
570
|
+
};
|
|
571
|
+
/**
|
|
572
|
+
* Generates the data for the start event.
|
|
573
|
+
*
|
|
574
|
+
* @typedef {Object} Device
|
|
575
|
+
* @property {string} id The device ID.
|
|
576
|
+
*
|
|
577
|
+
* @typedef {Object} StartEventData
|
|
578
|
+
* @property {string} browser The user agent string of the browser.
|
|
579
|
+
* @property {Device} device Information about the device.
|
|
580
|
+
* @property {MediaInfo} media Information about the media.
|
|
581
|
+
* @property {PlayerInfo} player Information about the player.
|
|
582
|
+
* @property {QoeTimings} qoe_timings Quality of Experience timings.
|
|
583
|
+
* @property {QosTimings} qos_timings Quality of Service timings.
|
|
584
|
+
* @property {PlayerCurrentDimensions} screen The current dimensions of the
|
|
585
|
+
* player.
|
|
586
|
+
*
|
|
587
|
+
* @returns {StartEventData} An object containing the start event data.
|
|
588
|
+
*/
|
|
589
|
+
startEventData(): {
|
|
590
|
+
/**
|
|
591
|
+
* The user agent string of the browser.
|
|
592
|
+
*/
|
|
593
|
+
browser: string;
|
|
594
|
+
/**
|
|
595
|
+
* Information about the device.
|
|
596
|
+
*/
|
|
597
|
+
device: {
|
|
598
|
+
/**
|
|
599
|
+
* The device ID.
|
|
600
|
+
*/
|
|
601
|
+
id: string;
|
|
602
|
+
};
|
|
603
|
+
/**
|
|
604
|
+
* Information about the media.
|
|
605
|
+
*/
|
|
606
|
+
media: {
|
|
607
|
+
/**
|
|
608
|
+
* The URL of the media
|
|
609
|
+
*/
|
|
610
|
+
asset_url: string;
|
|
611
|
+
/**
|
|
612
|
+
* The ID of the media
|
|
613
|
+
*/
|
|
614
|
+
id: string;
|
|
615
|
+
/**
|
|
616
|
+
* The URL of the media metadata
|
|
617
|
+
*/
|
|
618
|
+
metadata_url: string;
|
|
619
|
+
/**
|
|
620
|
+
* The origin of the media
|
|
621
|
+
*/
|
|
622
|
+
origin: string;
|
|
623
|
+
};
|
|
624
|
+
/**
|
|
625
|
+
* Information about the player.
|
|
626
|
+
*/
|
|
627
|
+
player: {
|
|
628
|
+
/**
|
|
629
|
+
* The name of the player
|
|
630
|
+
*/
|
|
631
|
+
name: string;
|
|
632
|
+
/**
|
|
633
|
+
* The version of the player
|
|
634
|
+
*/
|
|
635
|
+
version: string;
|
|
636
|
+
/**
|
|
637
|
+
* The platform on which the player is running
|
|
638
|
+
*/
|
|
639
|
+
platform: string;
|
|
640
|
+
};
|
|
641
|
+
/**
|
|
642
|
+
* Quality of Experience timings.
|
|
643
|
+
*/
|
|
644
|
+
qoe_timings: {
|
|
645
|
+
/**
|
|
646
|
+
* The time taken to load metadata
|
|
647
|
+
*/
|
|
648
|
+
metadata: number;
|
|
649
|
+
/**
|
|
650
|
+
* The time taken to load the asset
|
|
651
|
+
*/
|
|
652
|
+
asset: number;
|
|
653
|
+
/**
|
|
654
|
+
* The total time taken from session start to data load
|
|
655
|
+
*/
|
|
656
|
+
total: number;
|
|
657
|
+
};
|
|
658
|
+
/**
|
|
659
|
+
* Quality of Service timings.
|
|
660
|
+
*/
|
|
661
|
+
qos_timings: {
|
|
662
|
+
/**
|
|
663
|
+
* The time taken to load the asset
|
|
664
|
+
*/
|
|
665
|
+
asset: number;
|
|
666
|
+
/**
|
|
667
|
+
* The time taken for DRM processing
|
|
668
|
+
*/
|
|
669
|
+
drm: number;
|
|
670
|
+
/**
|
|
671
|
+
* The time taken to load metadata
|
|
672
|
+
*/
|
|
673
|
+
metadata: number;
|
|
674
|
+
/**
|
|
675
|
+
* The time taken to request the token
|
|
676
|
+
*/
|
|
677
|
+
token: number;
|
|
678
|
+
};
|
|
679
|
+
/**
|
|
680
|
+
* The current dimensions of the
|
|
681
|
+
* player.
|
|
682
|
+
*/
|
|
683
|
+
screen: {
|
|
684
|
+
/**
|
|
685
|
+
* The current width of the player
|
|
686
|
+
*/
|
|
687
|
+
width: number;
|
|
688
|
+
/**
|
|
689
|
+
* The current height of the player
|
|
690
|
+
*/
|
|
691
|
+
height: number;
|
|
692
|
+
};
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
//# sourceMappingURL=PillarboxMonitoring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PillarboxMonitoring.d.ts","sourceRoot":"","sources":["../../../../src/trackers/PillarboxMonitoring.js"],"names":[],"mappings":";AAIA;;;;;;;;;;;;;;GAcG;AACH;IA+xBE;;;;OAIG;IACH,oBAFa,MAAM,CAIlB;IAED;;;;;OAKG;IACH,mBAHa,MAAM,GAAC,SAAS,CAe5B;IAED;;;;OAIG;IACH,qBAFa,MAAM,CAclB;IAED;;;;;;OAMG;IACH,sCAJW,MAAM,GAEJ,MAAM,CAIlB;IAED;;;;OAIG;IACH,oBAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,oBAFa,MAAM,CAMlB;IA32BD;;;;;;;OAsFC;IA9EC;;OAEG;IACH,QAFU,OAAO,4BAA4B,EAAE,OAAO,CAElC;IACpB;;OAEG;IACH,YAFU,MAAM,CAEY;IAC5B;;OAEG;IACH,eAFU,MAAM,CAEkB;IAClC;;OAEG;IACH,UAFU,MAAM,CAEQ;IACxB;;OAEG;IACH,eAFU,MAAM,CAEkB;IAClC;;OAEG;IACH,0BAA0C;IAC1C;;OAEG;IACH,WAFU,MAAM,CAEU;IAC1B;;OAEG;IACH,kBAFU,MAAM,CAEiB;IACjC;;OAEG;IACH,6BAA6B;IAC7B;;OAEG;IACH,mCAAmC;IACnC;;OAEG;IACH,uBAAuB;IACvB;;OAEG;IACH,0BAA0B;IAC1B;;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;;;;;;;mBAvDN,MAAM;;;;oBACN,MAAM;;MAmVnB;CAgFF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SRGAnalytics.d.ts","sourceRoot":"","sources":["../../../../src/trackers/SRGAnalytics.js"],"names":[],"mappings":";AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH;IA6lBE;;;;OAIG;IACH,qBAEC;IAnmBD;;;;;OA+BC;IAtBC,wBAA2B;IAC3B,4BAA4B;IAC5B,oBAA8B;IAC9B,oBAAuB;IACvB,oCAAoC;IAEpC,qBAAwB;IACxB,mBAAsB;IACtB,mBAAsB;IACtB,qBAAqB;IACrB,oBAAsB;IACtB,mCAAsC;IACtC,YAAoB;IACpB,sBAAkC;IAClC,kBAA6B;IAC7B,6BAA6B;IAC7B,8BAAkD;IAClD,2BAA2B;IAC3B,iCAAiC;IAMnC;;;;OAIG;IACH,qBAEC;IAED;;OAEG;IACH,oBAIC;IAED;;;;OAIG;IACH,sBAGC;IAED;;;;OAIG;IACH,qBAFa,UAAQ,SAAS,CAQ7B;IAED;;OAEG;IACH,gBAiBC;IAED;;;;;;;;;;;;;;;OAeG;IACH,gBAgBC;IAED;;;;OAIG;IACH,gBAIC;IAED;;;;OAIG;IACH,cAMC;IAED;;OAEG;IACH,cAmBC;IAED;;;;OAIG;IACH,+BAYC;IAED;;;;OAIG;IACH,8BAUC;IAED;;;;OAIG;IACH,+BAMC;IAED;;;;OAIG;IACH,2BAKC;IAED;;;;OAIG;IACH,iCAMC;IAED;;;;OAIG;IACH,gCAIC;IAED;;;;;;OAMG;IACH,uCA+CC;IAED;;OAEG;IACH,0BAcC;IAED;;;;;;;;;;OAUG;IACH,kBAOC;IAED;;;;;;;;;;;;;;;OAeG;IACH,sBAYC;IAXC,0BAAwD;IACxD,qBAA8C;IAC9C,mBAA0C;IAC1C,uBAAkD;IAClD,w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