bitmovin-analytics 2.29.0-beta1 → 2.29.0-beta2
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/bitmovin-analytics.d.ts
CHANGED
|
@@ -1,4 +1,652 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
export interface AnalyticsDebugConfig {
|
|
2
|
+
fields?: string[];
|
|
3
|
+
}
|
|
4
|
+
export interface CollectorConfig {
|
|
5
|
+
backendUrl?: string;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
cookiesEnabled?: boolean;
|
|
8
|
+
cookiesDomain?: string;
|
|
9
|
+
origin?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface AnalyticsConfig {
|
|
12
|
+
debug?: boolean | AnalyticsDebugConfig;
|
|
13
|
+
key?: string;
|
|
14
|
+
playerKey?: string;
|
|
15
|
+
player?: string;
|
|
16
|
+
cdnProvider?: string;
|
|
17
|
+
videoId?: string;
|
|
18
|
+
title?: string;
|
|
19
|
+
userId?: string;
|
|
20
|
+
customUserId?: string;
|
|
21
|
+
customData1?: any;
|
|
22
|
+
customData2?: any;
|
|
23
|
+
customData3?: any;
|
|
24
|
+
customData4?: any;
|
|
25
|
+
customData5?: any;
|
|
26
|
+
customData6?: any;
|
|
27
|
+
customData7?: any;
|
|
28
|
+
customData8?: any;
|
|
29
|
+
customData9?: any;
|
|
30
|
+
customData10?: any;
|
|
31
|
+
customData11?: any;
|
|
32
|
+
customData12?: any;
|
|
33
|
+
customData13?: any;
|
|
34
|
+
customData14?: any;
|
|
35
|
+
customData15?: any;
|
|
36
|
+
customData16?: any;
|
|
37
|
+
customData17?: any;
|
|
38
|
+
customData18?: any;
|
|
39
|
+
customData19?: any;
|
|
40
|
+
customData20?: any;
|
|
41
|
+
customData21?: any;
|
|
42
|
+
customData22?: any;
|
|
43
|
+
customData23?: any;
|
|
44
|
+
customData24?: any;
|
|
45
|
+
customData25?: any;
|
|
46
|
+
customData26?: any;
|
|
47
|
+
customData27?: any;
|
|
48
|
+
customData28?: any;
|
|
49
|
+
customData29?: any;
|
|
50
|
+
customData30?: any;
|
|
51
|
+
experimentName?: string;
|
|
52
|
+
isLive?: boolean;
|
|
53
|
+
config?: CollectorConfig;
|
|
54
|
+
}
|
|
55
|
+
export interface CustomDataValues {
|
|
56
|
+
customData1?: string;
|
|
57
|
+
customData2?: string;
|
|
58
|
+
customData3?: string;
|
|
59
|
+
customData4?: string;
|
|
60
|
+
customData5?: string;
|
|
61
|
+
customData6?: string;
|
|
62
|
+
customData7?: string;
|
|
63
|
+
customData8?: string;
|
|
64
|
+
customData9?: string;
|
|
65
|
+
customData10?: string;
|
|
66
|
+
customData11?: string;
|
|
67
|
+
customData12?: string;
|
|
68
|
+
customData13?: string;
|
|
69
|
+
customData14?: string;
|
|
70
|
+
customData15?: string;
|
|
71
|
+
customData16?: string;
|
|
72
|
+
customData17?: string;
|
|
73
|
+
customData18?: string;
|
|
74
|
+
customData19?: string;
|
|
75
|
+
customData20?: string;
|
|
76
|
+
customData21?: string;
|
|
77
|
+
customData22?: string;
|
|
78
|
+
customData23?: string;
|
|
79
|
+
customData24?: string;
|
|
80
|
+
customData25?: string;
|
|
81
|
+
customData26?: string;
|
|
82
|
+
customData27?: string;
|
|
83
|
+
customData28?: string;
|
|
84
|
+
customData29?: string;
|
|
85
|
+
customData30?: string;
|
|
86
|
+
experimentName?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface AdapterAPI {
|
|
89
|
+
getCurrentImpressionId: () => string | undefined;
|
|
90
|
+
getUserId: () => string | undefined;
|
|
91
|
+
setCustomData: (values: CustomDataValues) => void;
|
|
92
|
+
setCustomDataOnce: (values: CustomDataValues) => void;
|
|
93
|
+
sourceChange: (config: AnalyticsConfig) => void;
|
|
94
|
+
}
|
|
95
|
+
export interface AnalyticsStateMachineOptions {
|
|
96
|
+
starttime: any;
|
|
97
|
+
}
|
|
98
|
+
export interface Timespan {
|
|
99
|
+
start: number;
|
|
100
|
+
end: number;
|
|
101
|
+
}
|
|
102
|
+
declare class VideoCompletionTracker {
|
|
103
|
+
private watched;
|
|
104
|
+
private videoDuration;
|
|
105
|
+
reset(): void;
|
|
106
|
+
/**
|
|
107
|
+
* sets video Duration
|
|
108
|
+
* @param videoDuration in sec
|
|
109
|
+
*/
|
|
110
|
+
setVideoDuration(videoDuration: number): void;
|
|
111
|
+
/**
|
|
112
|
+
* Adds the watched timespan to the tracker
|
|
113
|
+
* @param watched watched timespan you want to add to the tracker
|
|
114
|
+
* @returns how much time(video parts which have not been seen yet) was added to the tracker
|
|
115
|
+
*/
|
|
116
|
+
addWatched(watched: Timespan): number;
|
|
117
|
+
/**
|
|
118
|
+
* returns the relative value of how much the user watch the content of the video
|
|
119
|
+
*/
|
|
120
|
+
getCompletionPercentage(): number;
|
|
121
|
+
/**
|
|
122
|
+
* Recursive Method to merge All Watched Blocks
|
|
123
|
+
* @param watched
|
|
124
|
+
*
|
|
125
|
+
* @returns how much timespan was overlapping while merging the watchBlocks
|
|
126
|
+
*/
|
|
127
|
+
private mergeWatched;
|
|
128
|
+
private getOverlappingType;
|
|
129
|
+
private isMomentInTimespan;
|
|
130
|
+
private mergeAndReplace;
|
|
131
|
+
private getOverlappingTimespan;
|
|
132
|
+
private getDuration;
|
|
133
|
+
}
|
|
134
|
+
export interface FeatureConfig {
|
|
135
|
+
enabled: boolean | undefined;
|
|
136
|
+
}
|
|
137
|
+
declare abstract class Feature<TConfigContainer, TConfig extends FeatureConfig> {
|
|
138
|
+
private _config?;
|
|
139
|
+
private _isEnabled;
|
|
140
|
+
get config(): TConfig | undefined;
|
|
141
|
+
get isEnabled(): boolean;
|
|
142
|
+
abstract reset(): void;
|
|
143
|
+
abstract enabled(): void;
|
|
144
|
+
abstract disabled(): void;
|
|
145
|
+
abstract configured(authenticated: boolean, config?: TConfig): void;
|
|
146
|
+
disable(): void;
|
|
147
|
+
configure(authenticated: boolean, configContainer?: TConfigContainer): TConfig | undefined;
|
|
148
|
+
abstract extractConfig(configContainer: TConfigContainer): TConfig | undefined;
|
|
149
|
+
}
|
|
150
|
+
export interface DownloadSpeedInfo {
|
|
151
|
+
/**
|
|
152
|
+
* Number of completed segment downloads
|
|
153
|
+
*/
|
|
154
|
+
segmentsDownloadCount: number;
|
|
155
|
+
/**
|
|
156
|
+
* Total download size in bytes
|
|
157
|
+
*/
|
|
158
|
+
segmentsDownloadSize: number;
|
|
159
|
+
/**
|
|
160
|
+
* Total time spent downloading segments in milliseconds
|
|
161
|
+
*/
|
|
162
|
+
segmentsDownloadTime: number;
|
|
163
|
+
/**
|
|
164
|
+
* Average download speed in kbps
|
|
165
|
+
*/
|
|
166
|
+
avgDownloadSpeed: number;
|
|
167
|
+
/**
|
|
168
|
+
* Maximum download speed in kbps
|
|
169
|
+
*/
|
|
170
|
+
maxDownloadSpeed: number;
|
|
171
|
+
/**
|
|
172
|
+
* Minimum download speed in kbps
|
|
173
|
+
*/
|
|
174
|
+
minDownloadSpeed: number;
|
|
175
|
+
/**
|
|
176
|
+
* Average time to first byte in milliseconds
|
|
177
|
+
*/
|
|
178
|
+
avgTimeToFirstByte: number;
|
|
179
|
+
}
|
|
180
|
+
export interface DrmPerformanceInfo {
|
|
181
|
+
readonly drmType: string;
|
|
182
|
+
readonly drmLoadTime: number;
|
|
183
|
+
}
|
|
184
|
+
export interface ErrorDetailTrackingConfig extends FeatureConfig {
|
|
185
|
+
numberOfHttpRequests: number | undefined;
|
|
186
|
+
}
|
|
187
|
+
export interface FeatureConfigContainer {
|
|
188
|
+
errorDetails?: ErrorDetailTrackingConfig;
|
|
189
|
+
}
|
|
190
|
+
declare enum PlayerSize {
|
|
191
|
+
Window = "WINDOW",
|
|
192
|
+
Fullscreen = "FULLSCREEN"
|
|
193
|
+
}
|
|
194
|
+
export interface PlaybackInfo {
|
|
195
|
+
isLive?: boolean;
|
|
196
|
+
playerTech?: string;
|
|
197
|
+
videoDuration?: number;
|
|
198
|
+
streamFormat?: string;
|
|
199
|
+
progUrl?: string;
|
|
200
|
+
m3u8Url?: string;
|
|
201
|
+
mpdUrl?: string;
|
|
202
|
+
videoWindowWidth?: number;
|
|
203
|
+
videoWindowHeight?: number;
|
|
204
|
+
isMuted?: boolean;
|
|
205
|
+
videoBitrate?: number;
|
|
206
|
+
audioBitrate?: number;
|
|
207
|
+
droppedFrames: number;
|
|
208
|
+
isCasting?: boolean;
|
|
209
|
+
castTech?: string;
|
|
210
|
+
screenHeight?: number;
|
|
211
|
+
screenWidth?: number;
|
|
212
|
+
videoPlaybackHeight?: number;
|
|
213
|
+
videoPlaybackWidth?: number;
|
|
214
|
+
videoTitle?: string;
|
|
215
|
+
size?: PlayerSize;
|
|
216
|
+
audioCodec?: string;
|
|
217
|
+
videoCodec?: string;
|
|
218
|
+
audioLanguage?: string;
|
|
219
|
+
subtitleEnabled?: boolean;
|
|
220
|
+
subtitleLanguage?: string;
|
|
221
|
+
}
|
|
222
|
+
export interface SegmentInfo {
|
|
223
|
+
name: string;
|
|
224
|
+
timestamp: number;
|
|
225
|
+
url: string;
|
|
226
|
+
}
|
|
227
|
+
declare class ErrorCode {
|
|
228
|
+
readonly code: number;
|
|
229
|
+
readonly message: string;
|
|
230
|
+
static BITMOVIN_PLAYER_LICENSING_ERROR: ErrorCode;
|
|
231
|
+
static SETUP_MISSING_LICENSE_WHITELIST: ErrorCode;
|
|
232
|
+
static QUALITY_CHANGE_THRESHOLD_EXCEEDED: ErrorCode;
|
|
233
|
+
static BUFFERING_TIMEOUT_REACHED: ErrorCode;
|
|
234
|
+
static VIDEO_STARTUP_TIMEOUT_REACHED: ErrorCode;
|
|
235
|
+
private constructor();
|
|
236
|
+
}
|
|
237
|
+
declare class VideoStartFailedReason {
|
|
238
|
+
readonly reason: string;
|
|
239
|
+
readonly errorCode: ErrorCode | null;
|
|
240
|
+
static PAGE_CLOSED: VideoStartFailedReason;
|
|
241
|
+
static PLAYER_ERROR: VideoStartFailedReason;
|
|
242
|
+
static TIMEOUT: VideoStartFailedReason;
|
|
243
|
+
static UNKNOWN: VideoStartFailedReason;
|
|
244
|
+
private constructor();
|
|
245
|
+
}
|
|
246
|
+
export interface ErrorData {
|
|
247
|
+
exceptionMessage?: string | undefined;
|
|
248
|
+
exceptionStacktrace?: string[] | undefined;
|
|
249
|
+
additionalData?: string | undefined;
|
|
250
|
+
}
|
|
251
|
+
export interface AnalyticsEventBase {
|
|
252
|
+
currentTime?: number;
|
|
253
|
+
}
|
|
254
|
+
export interface ErrorEvent extends AnalyticsEventBase {
|
|
255
|
+
code: number | undefined;
|
|
256
|
+
message: string | undefined;
|
|
257
|
+
legacyData?: any;
|
|
258
|
+
data: ErrorData;
|
|
259
|
+
}
|
|
260
|
+
export interface VideoStartFailedEvent extends AnalyticsEventBase {
|
|
261
|
+
reason: VideoStartFailedReason;
|
|
262
|
+
}
|
|
263
|
+
export interface Sample extends CustomDataValues {
|
|
264
|
+
platform: string;
|
|
265
|
+
sequenceNumber?: number;
|
|
266
|
+
domain?: any;
|
|
267
|
+
path?: string;
|
|
268
|
+
language?: string;
|
|
269
|
+
userAgent?: string;
|
|
270
|
+
screenWidth?: number;
|
|
271
|
+
screenHeight?: number;
|
|
272
|
+
isLive?: boolean;
|
|
273
|
+
isCasting?: boolean;
|
|
274
|
+
castTech?: string;
|
|
275
|
+
videoDuration?: number;
|
|
276
|
+
size?: string;
|
|
277
|
+
time?: number;
|
|
278
|
+
videoWindowWidth?: number;
|
|
279
|
+
videoWindowHeight?: number;
|
|
280
|
+
droppedFrames?: number;
|
|
281
|
+
played?: number;
|
|
282
|
+
buffered?: number;
|
|
283
|
+
paused?: number;
|
|
284
|
+
ad?: number;
|
|
285
|
+
seeked?: number;
|
|
286
|
+
videoPlaybackWidth?: number;
|
|
287
|
+
videoPlaybackHeight?: number;
|
|
288
|
+
videoBitrate?: number;
|
|
289
|
+
audioBitrate?: number;
|
|
290
|
+
videoTimeStart?: number;
|
|
291
|
+
videoTimeEnd?: number;
|
|
292
|
+
videoStartupTime?: number;
|
|
293
|
+
duration?: number;
|
|
294
|
+
startupTime?: number;
|
|
295
|
+
analyticsVersion?: any;
|
|
296
|
+
playerStartupTime: number;
|
|
297
|
+
pageLoadType: number;
|
|
298
|
+
streamFormat?: string;
|
|
299
|
+
isMuted?: boolean;
|
|
300
|
+
progUrl?: string;
|
|
301
|
+
m3u8Url?: string;
|
|
302
|
+
mpdUrl?: string;
|
|
303
|
+
playerTech?: string;
|
|
304
|
+
version?: string;
|
|
305
|
+
player?: any;
|
|
306
|
+
state?: string;
|
|
307
|
+
impressionId?: string;
|
|
308
|
+
userId?: string;
|
|
309
|
+
errorMessage?: any;
|
|
310
|
+
errorCode?: any;
|
|
311
|
+
errorData?: string;
|
|
312
|
+
videoStartFailed?: boolean;
|
|
313
|
+
videoStartFailedReason?: string;
|
|
314
|
+
autoplay?: any;
|
|
315
|
+
pageLoadTime: number;
|
|
316
|
+
key?: string;
|
|
317
|
+
playerKey?: any;
|
|
318
|
+
cdnProvider?: any;
|
|
319
|
+
videoId?: string;
|
|
320
|
+
videoTitle?: string;
|
|
321
|
+
customUserId?: string;
|
|
322
|
+
drmType?: string;
|
|
323
|
+
drmLoadTime?: number;
|
|
324
|
+
subtitleEnabled?: boolean;
|
|
325
|
+
subtitleLanguage?: string;
|
|
326
|
+
downloadSpeedInfo?: DownloadSpeedInfo;
|
|
327
|
+
errorSegments?: any[];
|
|
328
|
+
audioCodec?: string;
|
|
329
|
+
videoCodec?: string;
|
|
330
|
+
supportedVideoCodecs?: string[];
|
|
331
|
+
audioLanguage?: string;
|
|
332
|
+
completed?: number;
|
|
333
|
+
completedTotal?: number;
|
|
334
|
+
}
|
|
335
|
+
export interface StateMachineCallbacks {
|
|
336
|
+
setup: (duration: number, state: string) => void;
|
|
337
|
+
startup: (duration: number, state: string) => void;
|
|
338
|
+
playing: (duration: number, state: string) => void;
|
|
339
|
+
heartbeat: (duration: number, state: string, payload: Pick<Sample, "played"> | Pick<Sample, "buffered">) => void;
|
|
340
|
+
qualitychange: (duration: number, state: string) => void;
|
|
341
|
+
qualitychange_pause: (duration: number, state: string) => void;
|
|
342
|
+
qualitychange_rebuffering: (duration: number, state: string) => void;
|
|
343
|
+
videoChange: (event: any) => void;
|
|
344
|
+
audioChange: (event: any) => void;
|
|
345
|
+
audiotrack_changing: () => void;
|
|
346
|
+
pause: (duration: number, state: string) => void;
|
|
347
|
+
paused_seeking: (duration: number, state: string) => void;
|
|
348
|
+
end_play_seeking: (duration: number, state: string) => void;
|
|
349
|
+
rebuffering: (duration: number, state: string) => void;
|
|
350
|
+
error: (event: Readonly<ErrorEvent>) => void;
|
|
351
|
+
end: (duration: number, state: string) => void;
|
|
352
|
+
unload: (duration: number, state: string) => void;
|
|
353
|
+
ad: (duration: number, state: string) => void;
|
|
354
|
+
mute: () => void;
|
|
355
|
+
unMute: () => void;
|
|
356
|
+
subtitle_changing: () => void;
|
|
357
|
+
setVideoTimeEndFromEvent: (event: any) => void;
|
|
358
|
+
setVideoTimeStartFromEvent: (event: any) => void;
|
|
359
|
+
videoStartFailed: (event: Readonly<VideoStartFailedEvent>, sendRequest: boolean) => void;
|
|
360
|
+
source_changing: (duration: number, state: string, event: any) => void;
|
|
361
|
+
ready: (duration: number, state: string, event: any) => void;
|
|
362
|
+
startCasting: (duration: number, event: any) => void;
|
|
363
|
+
casting: (duration: number, event: any) => void;
|
|
364
|
+
manualSourceChange: (event: {
|
|
365
|
+
config: AnalyticsConfig;
|
|
366
|
+
}) => void;
|
|
367
|
+
initialSourceChange: (event: {
|
|
368
|
+
config: AnalyticsConfig;
|
|
369
|
+
}) => void;
|
|
370
|
+
muting_ready: (duration: number, state: string, event: any) => void;
|
|
371
|
+
customdatachange: (duration?: number, state?: string, event?: {
|
|
372
|
+
values: CustomDataValues;
|
|
373
|
+
}) => void;
|
|
374
|
+
release: () => void;
|
|
375
|
+
playlistTransition: (event: Readonly<AnalyticsEventBase>) => void;
|
|
376
|
+
}
|
|
377
|
+
declare class AdCallbacks {
|
|
378
|
+
onAdStarted: (event: any) => void;
|
|
379
|
+
onAdFinished: (event: any) => void;
|
|
380
|
+
onAdBreakStarted: (event: any) => void;
|
|
381
|
+
onAdBreakFinished: (event: any) => void;
|
|
382
|
+
onAdClicked: (event: any) => void;
|
|
383
|
+
onAdError: (event: any) => void;
|
|
384
|
+
onAdManifestLoaded: (event: any) => void;
|
|
385
|
+
onAdQuartile: (event: any) => void;
|
|
386
|
+
onAdSkipped: (event: any) => void;
|
|
387
|
+
onPlay: (issuer?: string) => void;
|
|
388
|
+
onPause: (issuer?: string) => void;
|
|
389
|
+
onBeforeUnload: () => void;
|
|
390
|
+
}
|
|
391
|
+
export interface AdModuleAPI {
|
|
392
|
+
readonly adCallbacks: AdCallbacks;
|
|
393
|
+
isLinearAdActive: () => boolean;
|
|
394
|
+
getContainer: () => HTMLElement;
|
|
395
|
+
getAdModuleInfo: () => {
|
|
396
|
+
name?: string;
|
|
397
|
+
version?: string;
|
|
398
|
+
};
|
|
399
|
+
currentTime: () => number;
|
|
400
|
+
}
|
|
401
|
+
export interface Subscribable<TArgs> {
|
|
402
|
+
subscribe(callback: EventHandler<TArgs>): () => void;
|
|
403
|
+
unsubscribe(callback: EventHandler<TArgs>): any;
|
|
404
|
+
}
|
|
405
|
+
export type EventHandler<TArgs> = (args: TArgs) => void;
|
|
406
|
+
export interface DeferredLicenseLoadingAdapterAPI {
|
|
407
|
+
readonly supportsDeferredLicenseLoading?: boolean;
|
|
408
|
+
readonly onLicenseKeyReceived: Subscribable<{
|
|
409
|
+
licenseKey: string;
|
|
410
|
+
}>;
|
|
411
|
+
readonly onLicenseCallFailed: Subscribable<{}>;
|
|
412
|
+
}
|
|
413
|
+
export interface InternalAdapterAPI extends DeferredLicenseLoadingAdapterAPI {
|
|
414
|
+
readonly downloadSpeedInfo: DownloadSpeedInfo;
|
|
415
|
+
readonly segments: SegmentInfo[];
|
|
416
|
+
readonly stateMachineCallbacks: StateMachineCallbacks;
|
|
417
|
+
readonly adModule?: AdModuleAPI;
|
|
418
|
+
readonly videoCompletionTracker?: VideoCompletionTracker;
|
|
419
|
+
isQualityChangeEventEnabled(): boolean;
|
|
420
|
+
increaseQualityChangeCount(): void;
|
|
421
|
+
resetQualityChangeCount(): void;
|
|
422
|
+
resetSourceRelatedState(): void;
|
|
423
|
+
getPlayerVersion(): string;
|
|
424
|
+
getPlayerName(): string;
|
|
425
|
+
getPlayerTech(): string;
|
|
426
|
+
getAutoPlay(): boolean;
|
|
427
|
+
getDrmPerformanceInfo(): DrmPerformanceInfo | undefined;
|
|
428
|
+
initialize(analytics: Analytics): Array<Feature<FeatureConfigContainer, FeatureConfig>>;
|
|
429
|
+
getCurrentPlaybackInfo(): PlaybackInfo;
|
|
430
|
+
sourceChange(config: AnalyticsConfig, timestamp: number): any;
|
|
431
|
+
clearValues(): void;
|
|
432
|
+
onError?(): void;
|
|
433
|
+
setCustomData(values: CustomDataValues): void;
|
|
434
|
+
}
|
|
435
|
+
export interface OnErrorDetailEventObject {
|
|
436
|
+
code: number | undefined;
|
|
437
|
+
message: string | undefined;
|
|
438
|
+
errorData?: ErrorData | undefined;
|
|
439
|
+
}
|
|
440
|
+
export interface ErrorDetailTrackingSettingsProvider {
|
|
441
|
+
readonly licenseKey: string;
|
|
442
|
+
readonly domain: string;
|
|
443
|
+
readonly impressionId: string;
|
|
444
|
+
readonly collectorConfig?: CollectorConfig;
|
|
445
|
+
}
|
|
446
|
+
export interface CastClientConfig {
|
|
447
|
+
config: any;
|
|
448
|
+
domain: any;
|
|
449
|
+
path: string;
|
|
450
|
+
language: string;
|
|
451
|
+
userAgent: string;
|
|
452
|
+
impressionId: string;
|
|
453
|
+
userId: string;
|
|
454
|
+
}
|
|
455
|
+
export interface Backend {
|
|
456
|
+
sendRequest(sample: Sample): any;
|
|
457
|
+
sendUnloadRequest(sample: Sample): any;
|
|
458
|
+
sendRequestSynchronous(sample: Sample): any;
|
|
459
|
+
sendAdRequest(sample: any): any;
|
|
460
|
+
}
|
|
461
|
+
export interface AuthenticationCallback {
|
|
462
|
+
authenticationCompleted(success: boolean, featureConfigs: FeatureConfigContainer | undefined): void;
|
|
463
|
+
}
|
|
464
|
+
export interface LicensingRequest {
|
|
465
|
+
key?: string;
|
|
466
|
+
domain: string;
|
|
467
|
+
version: string;
|
|
468
|
+
}
|
|
469
|
+
declare class BackendFactory {
|
|
470
|
+
createBackend(analyticsConfig: AnalyticsConfig, licensingRequest: LicensingRequest, adapter: DeferredLicenseLoadingAdapterAPI, authenticationCallback: AuthenticationCallback): Backend;
|
|
471
|
+
private decorateWithDebuggingBackend;
|
|
472
|
+
private decorateWithBackendFromConfigIfAvailable;
|
|
473
|
+
private isEnabled;
|
|
474
|
+
private createInnerBackend;
|
|
475
|
+
}
|
|
476
|
+
declare class Analytics {
|
|
477
|
+
get version(): string;
|
|
478
|
+
static version: string;
|
|
479
|
+
static LICENSE_CALL_PENDING_TIMEOUT: number;
|
|
480
|
+
static PAGE_LOAD_TYPE_TIMEOUT: number;
|
|
481
|
+
static CAST_RECEIVER_CONFIG_MESSAGE: string;
|
|
482
|
+
pageLoadTime: number;
|
|
483
|
+
playerStartupTime: number;
|
|
484
|
+
videoStartupTime: number;
|
|
485
|
+
autoplay: boolean | undefined;
|
|
486
|
+
sample: Sample;
|
|
487
|
+
backend: Backend;
|
|
488
|
+
errorDetailTrackingSettingsProvider: ErrorDetailTrackingSettingsProvider;
|
|
489
|
+
get errorDetailSubscribable(): Subscribable<OnErrorDetailEventObject>;
|
|
490
|
+
private config;
|
|
491
|
+
private sessionHandler;
|
|
492
|
+
private droppedSampleFrames;
|
|
493
|
+
private startupTime;
|
|
494
|
+
private adapter;
|
|
495
|
+
private backendFactory;
|
|
496
|
+
private resetQualityChangeCountIntervalId?;
|
|
497
|
+
private featureManager;
|
|
498
|
+
private onErrorDetailEventDispatcher;
|
|
499
|
+
private adAnalytics;
|
|
500
|
+
private authenticationCallback;
|
|
501
|
+
constructor(config: AnalyticsConfig, adapter: InternalAdapterAPI, backendFactory?: BackendFactory);
|
|
502
|
+
getPlayerInformationFromAdapter(): {
|
|
503
|
+
player: string;
|
|
504
|
+
version: string;
|
|
505
|
+
playerTech: string;
|
|
506
|
+
};
|
|
507
|
+
updateSamplesToCastClientConfig(samples: Sample[], castClientConfig: CastClientConfig): void;
|
|
508
|
+
updateSampleToCastClientConfig(sample: Sample, castClientConfig: CastClientConfig): void;
|
|
509
|
+
init(): void;
|
|
510
|
+
release(): void;
|
|
511
|
+
setConfigParameters(sample?: Sample, config?: AnalyticsConfig): void;
|
|
512
|
+
generateNewImpressionId(): void;
|
|
513
|
+
setUserId(): void;
|
|
514
|
+
setupStateMachineCallbacks(): void;
|
|
515
|
+
guardAgainstMissingVideoTitle: (oldConfig: AnalyticsConfig, newConfig: AnalyticsConfig) => void;
|
|
516
|
+
guardAgainstMissingIsLive: (oldConfig: AnalyticsConfig, newConfig: AnalyticsConfig) => void;
|
|
517
|
+
sourceChange: (config: AnalyticsConfig) => void;
|
|
518
|
+
setCustomDataOnce: (values: CustomDataValues) => void;
|
|
519
|
+
setCustomData: (values: CustomDataValues) => void;
|
|
520
|
+
getCurrentImpressionId: () => string | undefined;
|
|
521
|
+
getUserId: () => string;
|
|
522
|
+
setDuration(duration: number): void;
|
|
523
|
+
setState(state: string): void;
|
|
524
|
+
setPlaybackVideoPropertiesFromEvent(event: any): void;
|
|
525
|
+
setPlaybackAudioPropertiesFromEvent(event: any): void;
|
|
526
|
+
setPlaybackInfoFromAdapter(): void;
|
|
527
|
+
setupSample(): Sample;
|
|
528
|
+
sendAnalyticsRequest(): void;
|
|
529
|
+
sendAnalyticsRequestAndClearValues(): void;
|
|
530
|
+
sendUnloadRequest(): void;
|
|
531
|
+
sendAnalyticsRequestSynchronous(): void;
|
|
532
|
+
clearValues(): void;
|
|
533
|
+
getIsLiveFromConfigOrPlaybackInfo(config: AnalyticsConfig, isLiveFromPlayback?: boolean): boolean;
|
|
534
|
+
getMergedCollectorConfig(newConfig: AnalyticsConfig, oldConfig?: AnalyticsConfig): CollectorConfig | undefined;
|
|
535
|
+
getMergedAnalyticsConfig(newConfig: AnalyticsConfig, oldConfig?: AnalyticsConfig): AnalyticsConfig;
|
|
536
|
+
/**
|
|
537
|
+
* This method sanitizes the input and updates the analytics config.
|
|
538
|
+
* @param values Object containing the customData and other fields
|
|
539
|
+
*/
|
|
540
|
+
private changeCustomData;
|
|
541
|
+
private buildDefaultAnalyticsConfigValues;
|
|
542
|
+
private checkForErrorsInConfig;
|
|
543
|
+
private getDomainFromConfig;
|
|
544
|
+
private createBackend;
|
|
545
|
+
private getDomain;
|
|
546
|
+
private setCompletionValues;
|
|
547
|
+
private setVideoTimeStart;
|
|
548
|
+
private setVideoTimeEnd;
|
|
549
|
+
private sendQualityChange;
|
|
550
|
+
private clearResetQualityChangeInterval;
|
|
551
|
+
}
|
|
552
|
+
declare abstract class Adapter {
|
|
553
|
+
protected analytics: Analytics;
|
|
554
|
+
protected internalAdapter: InternalAdapterAPI;
|
|
555
|
+
getCurrentImpressionId(): string | undefined;
|
|
556
|
+
getUserId(): string | undefined;
|
|
557
|
+
setCustomData(values: CustomDataValues): void;
|
|
558
|
+
setCustomDataOnce(values: CustomDataValues): void;
|
|
559
|
+
sourceChange(config: AnalyticsConfig): void;
|
|
560
|
+
protected hasPlayerAlreadyBeenAugmented(player: any): boolean;
|
|
561
|
+
protected markPlayerInstanceAsAugmented(player: any): void;
|
|
562
|
+
private guardAgainstNotInitializedAnalytics;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* @deprecated Please update to Bitmovin Player v8 and use the new {@link Bitmovin8Adapter} instead.
|
|
566
|
+
*/
|
|
567
|
+
export declare class Bitmovin7Adapter extends Adapter implements AdapterAPI {
|
|
568
|
+
constructor(player: any, opts?: AnalyticsStateMachineOptions);
|
|
569
|
+
private augment;
|
|
570
|
+
private wrapPlayerLoad;
|
|
571
|
+
}
|
|
572
|
+
export declare class Bitmovin8Adapter extends Adapter implements AdapterAPI {
|
|
573
|
+
constructor(player: any, opts?: AnalyticsStateMachineOptions);
|
|
574
|
+
private wrapPlayerLoad;
|
|
575
|
+
}
|
|
576
|
+
export declare class CAFv3Adapter extends Adapter implements AdapterAPI {
|
|
577
|
+
constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
|
|
578
|
+
}
|
|
579
|
+
export declare class DashjsAdapter extends Adapter implements AdapterAPI {
|
|
580
|
+
constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
|
|
581
|
+
}
|
|
582
|
+
export declare class HlsAdapter extends Adapter implements AdapterAPI {
|
|
583
|
+
constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
|
|
584
|
+
}
|
|
585
|
+
export declare class HTMLVideoElementAdapter extends Adapter implements AdapterAPI {
|
|
586
|
+
constructor(config: AnalyticsConfig, player: HTMLVideoElement, opts?: AnalyticsStateMachineOptions);
|
|
587
|
+
}
|
|
588
|
+
export declare class ShakaAdapter extends Adapter implements AdapterAPI {
|
|
589
|
+
constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
|
|
590
|
+
private wrapPlayerLoad;
|
|
591
|
+
private sendError;
|
|
592
|
+
}
|
|
593
|
+
export declare class VideojsAdapter extends Adapter implements AdapterAPI {
|
|
594
|
+
constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
|
|
595
|
+
}
|
|
596
|
+
declare enum CdnProvider {
|
|
597
|
+
CLOUDFLARE = "cloudflare",
|
|
598
|
+
AKAMAI = "akamai",
|
|
599
|
+
FASTLY = "fastly",
|
|
600
|
+
MAXCDN = "maxcdn",
|
|
601
|
+
CLOUDFRONT = "cloudfront",
|
|
602
|
+
CHINACACHE = "chinacache",
|
|
603
|
+
BITGRAVITY = "bitgravity"
|
|
604
|
+
}
|
|
605
|
+
declare enum Player {
|
|
606
|
+
BITMOVIN = "bitmovin",
|
|
607
|
+
JW = "jw",
|
|
608
|
+
RADIANT = "radiant",
|
|
609
|
+
VIDEOJS = "videojs",
|
|
610
|
+
HLSJS = "hlsjs",
|
|
611
|
+
SHAKA = "shaka",
|
|
612
|
+
DASHJS = "dashjs",
|
|
613
|
+
HTML5 = "html5",
|
|
614
|
+
CHROMECAST_SHAKA = "chromecast-shaka"
|
|
615
|
+
}
|
|
616
|
+
declare const VERSION: string;
|
|
617
|
+
declare const AnalyticsModule: {
|
|
618
|
+
name: string;
|
|
619
|
+
module: {
|
|
620
|
+
Analytics: typeof Bitmovin8Adapter;
|
|
621
|
+
};
|
|
622
|
+
hooks: {
|
|
623
|
+
setup: (module: any, player: any) => Promise<any>;
|
|
624
|
+
};
|
|
625
|
+
};
|
|
626
|
+
export declare const adapters: {
|
|
627
|
+
HlsAdapter: typeof HlsAdapter;
|
|
628
|
+
Bitmovin8Adapter: typeof Bitmovin8Adapter;
|
|
629
|
+
Bitmovin7Adapter: typeof Bitmovin7Adapter;
|
|
630
|
+
VideojsAdapter: typeof VideojsAdapter;
|
|
631
|
+
ShakaAdapter: typeof ShakaAdapter;
|
|
632
|
+
DashjsAdapter: typeof DashjsAdapter;
|
|
633
|
+
CAFv3Adapter: typeof CAFv3Adapter;
|
|
634
|
+
HTMLVideoElementAdapter: typeof HTMLVideoElementAdapter;
|
|
635
|
+
};
|
|
636
|
+
declare const _default: {
|
|
637
|
+
PlayerModule: {
|
|
638
|
+
name: string;
|
|
639
|
+
module: {
|
|
640
|
+
Analytics: typeof Bitmovin8Adapter;
|
|
641
|
+
};
|
|
642
|
+
hooks: {
|
|
643
|
+
setup: (module: any, player: any) => Promise<any>;
|
|
644
|
+
};
|
|
645
|
+
};
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
export {
|
|
649
|
+
_default as default,
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
export {};
|