bitmovin-analytics 2.37.1 → 2.39.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.
@@ -1,4 +1,3 @@
1
- declare const VERSION: string;
2
1
  export interface AnalyticsDebugConfig {
3
2
  fields?: string[];
4
3
  }
@@ -11,17 +10,19 @@ export interface CollectorConfig {
11
10
  origin?: string;
12
11
  }
13
12
  export interface AnalyticsConfig {
14
- debug?: boolean | AnalyticsDebugConfig;
15
- deviceType?: string;
16
- deviceClass?: "Console" | "Desktop" | "Phone" | "STB" | "TV" | "Tablet" | "Wearable" | "Other";
13
+ config?: CollectorConfig;
14
+ debug?: AnalyticsDebugConfig | boolean;
17
15
  key?: string;
18
16
  playerKey?: string;
17
+ deviceType?: string;
18
+ deviceClass?: "Console" | "Desktop" | "Other" | "Phone" | "STB" | "Tablet" | "TV" | "Wearable";
19
19
  player?: string;
20
+ userId?: string;
21
+ customUserId?: string;
20
22
  cdnProvider?: string;
21
23
  videoId?: string;
22
24
  title?: string;
23
- userId?: string;
24
- customUserId?: string;
25
+ isLive?: boolean;
25
26
  customData1?: any;
26
27
  customData2?: any;
27
28
  customData3?: any;
@@ -53,8 +54,6 @@ export interface AnalyticsConfig {
53
54
  customData29?: any;
54
55
  customData30?: any;
55
56
  experimentName?: string;
56
- isLive?: boolean;
57
- config?: CollectorConfig;
58
57
  }
59
58
  export interface CustomDataValues {
60
59
  customData1?: string;
@@ -93,21 +92,22 @@ export interface CustomDataValues {
93
92
  * Minimal set of shared methods among all collectors
94
93
  */
95
94
  export interface AdapterAPI {
95
+ get version(): string;
96
96
  getCurrentImpressionId: () => string | undefined;
97
97
  getUserId: () => string | undefined;
98
98
  setCustomData: (values: CustomDataValues) => void;
99
99
  setCustomDataOnce: (values: CustomDataValues) => void;
100
100
  sourceChange: (config: AnalyticsConfig) => void;
101
101
  }
102
- export interface SsaiAdMetadata {
102
+ export type SsaiAdMetadata = {
103
103
  adId?: string;
104
104
  adSystem?: string;
105
105
  customData?: CustomDataValues;
106
- }
107
- export interface SsaiAdBreakMetadata {
106
+ };
107
+ export type SsaiAdBreakMetadata = {
108
108
  adPosition?: AdPosition;
109
- }
110
- export type AdPosition = "preroll" | "midroll" | "postroll";
109
+ };
110
+ export type AdPosition = "midroll" | "postroll" | "preroll";
111
111
  export interface SsaiApi {
112
112
  adBreakStart(adBreakMetadata?: SsaiAdBreakMetadata): any;
113
113
  adStart(adMetadata?: SsaiAdMetadata): any;
@@ -116,600 +116,144 @@ export interface SsaiApi {
116
116
  export interface AnalyticsStateMachineOptions {
117
117
  starttime: any;
118
118
  }
119
- declare class ErrorCode {
120
- readonly code: number;
121
- readonly message: string;
122
- static BITMOVIN_PLAYER_LICENSING_ERROR: ErrorCode;
123
- static SETUP_MISSING_LICENSE_WHITELIST: ErrorCode;
124
- static QUALITY_CHANGE_THRESHOLD_EXCEEDED: ErrorCode;
125
- static BUFFERING_TIMEOUT_REACHED: ErrorCode;
126
- static VIDEO_STARTUP_TIMEOUT_REACHED: ErrorCode;
127
- private constructor();
128
- }
129
- declare class VideoStartFailedReason {
130
- readonly reason: string;
131
- readonly errorCode: ErrorCode | null;
132
- static PAGE_CLOSED: VideoStartFailedReason;
133
- static PLAYER_ERROR: VideoStartFailedReason;
134
- static TIMEOUT: VideoStartFailedReason;
135
- static UNKNOWN: VideoStartFailedReason;
136
- private constructor();
137
- }
138
- export interface ErrorData {
139
- exceptionMessage?: string | undefined;
140
- exceptionStacktrace?: string[] | undefined;
141
- additionalData?: string | undefined;
142
- }
143
- export interface AnalyticsEventBase {
144
- currentTime?: number;
145
- }
146
- interface ErrorEvent$1 extends AnalyticsEventBase {
147
- code: number | undefined;
148
- message: string | undefined;
149
- legacyData?: any;
150
- data: ErrorData;
151
- }
152
- export interface VideoStartFailedEvent extends AnalyticsEventBase {
153
- reason: VideoStartFailedReason;
154
- }
155
- export interface SsaiEventHandler {
156
- onSsaiInteraction: (timestamp: number, eventData: AnalyticsEventBase) => void;
157
- }
158
- export interface DownloadSpeedInfo {
159
- /**
160
- * Number of completed segment downloads
161
- */
162
- segmentsDownloadCount: number;
163
- /**
164
- * Total download size in bytes
165
- */
166
- segmentsDownloadSize: number;
167
- /**
168
- * Total time spent downloading segments in milliseconds
169
- */
170
- segmentsDownloadTime: number;
171
- /**
172
- * Average download speed in kbps
173
- */
174
- avgDownloadSpeed: number;
175
- /**
176
- * Maximum download speed in kbps
177
- */
178
- maxDownloadSpeed: number;
179
- /**
180
- * Minimum download speed in kbps
181
- */
182
- minDownloadSpeed: number;
183
- /**
184
- * Average time to first byte in milliseconds
185
- */
186
- avgTimeToFirstByte: number;
187
- }
188
- export interface Sample extends CustomDataValues {
189
- ad?: 0 | 1 | 2;
190
- adId?: string;
191
- adSystem?: string;
192
- adPosition?: string;
193
- adIndex?: number;
194
- analyticsVersion?: any;
195
- audioBitrate?: number;
196
- audioCodec?: string;
197
- audioLanguage?: string;
198
- autoplay?: any;
199
- buffered?: number;
200
- castTech?: string;
201
- cdnProvider?: any;
202
- completed?: number;
203
- completedTotal?: number;
204
- customUserId?: string;
205
- deviceInformation?: {
206
- model?: string;
207
- deviceClass?: string;
208
- };
209
- domain?: any;
210
- downloadSpeedInfo?: DownloadSpeedInfo;
211
- drmLoadTime?: number;
212
- drmType?: string;
213
- droppedFrames?: number;
214
- duration?: number;
215
- errorCode?: number;
216
- errorData?: string;
217
- errorMessage?: string;
218
- errorSegments?: any[];
219
- impressionId?: string;
220
- isCasting?: boolean;
221
- isLive?: boolean;
222
- isMuted?: boolean;
223
- key?: string;
224
- language?: string;
225
- m3u8Url?: string;
226
- mpdUrl?: string;
227
- pageLoadTime: number;
228
- pageLoadType: number;
229
- path?: string;
230
- paused?: number;
231
- platform: string;
232
- played?: number;
233
- player?: any;
234
- playerKey?: any;
235
- playerStartupTime: number;
236
- playerTech?: string;
237
- progUrl?: string;
238
- screenHeight?: number;
239
- screenWidth?: number;
240
- seeked?: number;
241
- sequenceNumber?: number;
242
- size?: string;
243
- startupTime?: number;
244
- state?: string;
245
- streamFormat?: string;
246
- subtitleEnabled?: boolean;
247
- subtitleLanguage?: string;
248
- supportedVideoCodecs?: string[];
249
- time?: number;
250
- userAgent?: string;
251
- userId?: string;
252
- version?: string;
253
- videoBitrate?: number;
254
- videoCodec?: string;
255
- videoDuration?: number;
256
- videoId?: string;
257
- videoPlaybackHeight?: number;
258
- videoPlaybackWidth?: number;
259
- videoStartFailed?: boolean;
260
- videoStartFailedReason?: string;
261
- videoStartupTime?: number;
262
- videoTimeEnd?: number;
263
- videoTimeStart?: number;
264
- videoTitle?: string;
265
- videoWindowHeight?: number;
266
- videoWindowWidth?: number;
267
- }
268
- declare class SsaiService {
269
- /**
270
- * eventHandler is outside dependency.
271
- * Due to the structure it is not possible to pass it to constructor of this class
272
- */
273
- eventHandler: undefined | SsaiEventHandler;
274
- private state;
275
- /**
276
- * represents the current playing ad metdata
277
- * is `undefined` when no ad is playing (after endAdBreak)
278
- * or omitted by customer
279
- */
280
- private currentAdMetadata;
281
- private adIndex;
282
- private isFirstSampleOfAd;
283
- private player;
284
- constructor(player: any);
285
- adBreakStart(adBreakMetadata?: SsaiAdBreakMetadata): void;
286
- adStart(adMetadata?: SsaiAdMetadata): void;
287
- adBreakEnd(): void;
288
- private reset;
289
- resetSourceRelatedState(): void;
290
- manipulate(sample: Sample): void;
291
- }
292
- declare class QualityChangeService {
293
- private qualityChangeThreshold;
294
- private qualityChangeCount;
295
- private previousVideoBitrate;
296
- private previousAudioBitrate;
297
- private resetIntervalId?;
298
- private startupHasFinished;
299
- constructor(qualityChangeThreshold?: number);
300
- resetValues(): void;
301
- isQualityChangeEventEnabled(): boolean;
302
- increaseCounter(): void;
303
- shouldAllowVideoQualityChange(newBitrate: number | undefined): boolean;
304
- setVideoBitrate(newBitrate: number): void;
305
- setStartupHasFinished(): void;
306
- shouldAllowAudioQualityChange(newBitrate: number | undefined): boolean;
307
- setAudioBitrate(newBitrate: number): void;
308
- startResetInterval(): void;
309
- stopResetInterval(): void;
310
- private resetCounter;
311
- }
312
- export interface Timespan {
313
- start: number;
314
- end: number;
315
- }
316
- declare class VideoCompletionTracker {
317
- private watched;
318
- private videoDuration;
319
- reset(): void;
320
- /**
321
- * sets video Duration
322
- * @param videoDuration in sec
323
- */
324
- setVideoDuration(videoDuration: number): void;
325
- /**
326
- * Adds the watched timespan to the tracker
327
- * @param watched watched timespan you want to add to the tracker
328
- * @returns how much time(video parts which have not been seen yet) was added to the tracker
329
- */
330
- addWatched(watched: Timespan): number;
331
- /**
332
- * returns the relative value of how much the user watch the content of the video
333
- */
334
- getCompletionPercentage(): number;
335
- /**
336
- * Recursive Method to merge All Watched Blocks
337
- * @param watched
338
- *
339
- * @returns how much timespan was overlapping while merging the watchBlocks
340
- */
341
- private mergeWatched;
342
- private getOverlappingType;
343
- private isMomentInTimespan;
344
- private mergeAndReplace;
345
- private getOverlappingTimespan;
346
- private getDuration;
347
- }
348
- export interface FeatureConfig {
349
- enabled: boolean | undefined;
350
- }
351
- declare abstract class Feature<TConfigContainer, TConfig extends FeatureConfig> {
352
- private _config?;
353
- private _isEnabled;
354
- get config(): TConfig | undefined;
355
- get isEnabled(): boolean;
356
- abstract reset(): void;
357
- abstract enabled(): void;
358
- abstract disabled(): void;
359
- abstract configured(authenticated: boolean, config?: TConfig): void;
360
- disable(): void;
361
- configure(authenticated: boolean, configContainer?: TConfigContainer): TConfig | undefined;
362
- abstract extractConfig(configContainer: TConfigContainer): TConfig | undefined;
363
- }
364
- export interface DrmPerformanceInfo {
365
- readonly drmType: string;
366
- readonly drmLoadTime: number;
367
- }
368
- export interface ErrorDetailTrackingConfig extends FeatureConfig {
369
- numberOfHttpRequests: number | undefined;
370
- }
371
- export interface FeatureConfigContainer {
372
- errorDetails?: ErrorDetailTrackingConfig;
373
- }
374
- declare enum PlayerSize {
375
- Window = "WINDOW",
376
- Fullscreen = "FULLSCREEN"
377
- }
378
- export interface PlaybackInfo {
379
- isLive?: boolean;
380
- playerTech?: string;
381
- videoDuration?: number;
382
- streamFormat?: string;
383
- progUrl?: string;
384
- m3u8Url?: string;
385
- mpdUrl?: string;
386
- videoWindowWidth?: number;
387
- videoWindowHeight?: number;
388
- isMuted?: boolean;
389
- videoBitrate?: number;
390
- audioBitrate?: number;
391
- droppedFrames: number;
392
- isCasting?: boolean;
393
- castTech?: string;
394
- screenHeight?: number;
395
- screenWidth?: number;
396
- videoPlaybackHeight?: number;
397
- videoPlaybackWidth?: number;
398
- videoTitle?: string;
399
- size?: PlayerSize;
400
- audioCodec?: string;
401
- videoCodec?: string;
402
- audioLanguage?: string;
403
- subtitleEnabled?: boolean;
404
- subtitleLanguage?: string;
405
- }
406
- export interface SegmentInfo {
407
- name: string;
408
- timestamp: number;
409
- url: string;
410
- }
411
- export type HeartbeatPayload = Pick<Sample, "played"> | Pick<Sample, "buffered"> | Pick<Sample, "paused">;
412
- export interface StateMachineCallbacks {
413
- setup: (duration: number, state: string) => void;
414
- startup: (duration: number, state: string) => void;
415
- playing: (duration: number, state: string) => void;
416
- heartbeat: (duration: number, state: string, payload: HeartbeatPayload) => void;
417
- qualitychange: (duration: number, state: string) => void;
418
- qualitychange_pause: (duration: number, state: string) => void;
419
- qualitychange_rebuffering: (duration: number, state: string) => void;
420
- videoChange: (event: any) => void;
421
- audioChange: (event: any) => void;
422
- audiotrack_changing: () => void;
423
- pause: (duration: number, state: string) => void;
424
- paused_seeking: (duration: number, state: string) => void;
425
- end_play_seeking: (duration: number, state: string) => void;
426
- rebuffering: (duration: number, state: string) => void;
427
- error: (event: Readonly<ErrorEvent$1>) => void;
428
- end: (duration: number, state: string) => void;
429
- unload: (duration: number, state: string) => void;
430
- ad: (duration: number, state: string) => void;
431
- mute: () => void;
432
- unMute: () => void;
433
- subtitle_changing: () => void;
434
- setVideoTimeEndFromEvent: (event: AnalyticsEventBase | any) => void;
435
- setVideoTimeStartFromEvent: (event: AnalyticsEventBase | any) => void;
436
- videoStartFailed: (event: Readonly<VideoStartFailedEvent>, sendRequest: boolean) => void;
437
- startCasting: (duration: number, event: any) => void;
438
- casting: (duration: number, event: any) => void;
439
- manualSourceChange: (event: {
440
- config: AnalyticsConfig;
441
- }) => void;
442
- initialSourceChange: (event: {
443
- config: AnalyticsConfig;
444
- }) => void;
445
- muting_ready: (duration: number, state: string, event: any) => void;
446
- customdatachange: (duration?: number, state?: string, event?: {
447
- values: CustomDataValues;
448
- }) => void;
449
- /** shuts down the collection and removes/clears all timeouts, intervals, event listeners */
450
- release: () => void;
451
- playlistTransition: (event: Readonly<AnalyticsEventBase>) => void;
452
- }
453
- export interface Subscribable<TArgs> {
454
- subscribe(callback: EventHandler<TArgs>): () => void;
455
- unsubscribe(callback: EventHandler<TArgs>): any;
456
- }
457
- export type EventHandler<TArgs> = (args: TArgs) => void;
458
- declare class EventDispatcher<TArgs> implements Subscribable<TArgs> {
459
- private callbacks;
460
- subscribe(callback: EventHandler<TArgs>): () => void;
461
- dispatch(args: TArgs): void;
462
- unsubscribe(callback: EventHandler<TArgs>): void;
463
- get subscriberCount(): number;
464
- }
465
- export interface DeferredLicenseLoadingAdapterAPI {
466
- readonly supportsDeferredLicenseLoading?: boolean;
467
- readonly onLicenseKeyReceived: Subscribable<{
468
- licenseKey: string;
469
- }>;
470
- readonly onLicenseCallFailed: Subscribable<any>;
471
- }
472
- declare class AdCallbacks {
473
- onAdStarted: (event: any) => void;
474
- onAdFinished: (event: any) => void;
475
- onAdBreakStarted: (event: any) => void;
476
- onAdBreakFinished: (event: any) => void;
477
- onAdClicked: (event: any) => void;
478
- onAdError: (event: any) => void;
479
- onAdManifestLoaded: (event: any) => void;
480
- onAdQuartile: (event: any) => void;
481
- onAdSkipped: (event: any) => void;
482
- onPlay: (issuer?: string) => void;
483
- onPause: (issuer?: string) => void;
484
- onBeforeUnload: () => void;
485
- }
486
- export interface AdModuleAPI {
487
- readonly adCallbacks: AdCallbacks;
488
- isLinearAdActive: () => boolean;
489
- getContainer: () => HTMLElement;
490
- getAdModuleInfo: () => {
491
- name?: string;
492
- version?: string;
493
- };
494
- currentTime: () => number;
495
- }
496
- export interface InternalAdapterAPI extends DeferredLicenseLoadingAdapterAPI {
497
- readonly downloadSpeedInfo: DownloadSpeedInfo;
498
- readonly segments: SegmentInfo[];
499
- readonly stateMachineCallbacks: StateMachineCallbacks;
500
- readonly adModule?: AdModuleAPI;
501
- readonly videoCompletionTracker?: VideoCompletionTracker;
502
- readonly qualityChangeService: QualityChangeService;
503
- resetSourceRelatedState(): void;
504
- getPlayerVersion(): string;
505
- getPlayerName(): string;
506
- getPlayerTech(): string;
507
- getAutoPlay(): boolean;
508
- getDrmPerformanceInfo(): DrmPerformanceInfo | undefined;
509
- initialize(analytics: Analytics): Array<Feature<FeatureConfigContainer, FeatureConfig>>;
510
- getCurrentPlaybackInfo(): PlaybackInfo;
511
- sourceChange(config: AnalyticsConfig): void;
512
- clearValues(): void;
513
- onError?(): void;
514
- setCustomData(values: CustomDataValues): void;
515
- }
516
- declare class FeatureManager<TConfigContainer> {
517
- private features;
518
- registerFeatures(features: Array<Feature<TConfigContainer, FeatureConfig>>): void;
519
- unregisterFeatures(): void;
520
- resetFeatures(): void;
521
- configureFeatures(authenticated: boolean, featureConfigs?: TConfigContainer): void;
522
- }
523
- export interface OnErrorDetailEventObject {
524
- code: number | undefined;
525
- message: string | undefined;
526
- errorData?: ErrorData | undefined;
527
- }
528
- export interface ErrorDetailTrackingSettingsProvider {
529
- readonly licenseKey: string;
530
- readonly domain: string;
531
- readonly impressionId: string;
532
- readonly collectorConfig?: CollectorConfig;
533
- }
534
- export interface Backend {
535
- sendRequest(sample: Sample): any;
536
- sendUnloadRequest(sample: Sample): any;
537
- sendRequestSynchronous(sample: Sample): any;
538
- sendAdRequest(sample: any): any;
539
- }
540
- export interface AuthenticationCallback {
541
- authenticationCompleted(success: boolean, featureConfigs: FeatureConfigContainer | undefined): void;
542
- }
543
- export interface LicensingRequest {
544
- key?: string;
545
- domain: string;
546
- version: string;
547
- }
548
- declare class BackendFactory {
549
- createBackend(analyticsConfig: AnalyticsConfig, licensingRequest: LicensingRequest, adapter: DeferredLicenseLoadingAdapterAPI, authenticationCallback: AuthenticationCallback): Backend;
550
- private decorateWithDebuggingBackend;
551
- private decorateWithBackendFromConfigIfAvailable;
552
- private isEnabled;
553
- private createInnerBackend;
554
- }
555
- declare class SessionPersistenceHandler {
556
- readonly userId: string;
557
- constructor(config: AnalyticsConfig);
558
- }
559
- declare class Analytics {
560
- private adapter;
561
- private readonly backendFactory;
562
- private readonly sessionHandler;
563
- private readonly featureManager;
564
- private readonly onErrorDetailEventDispatcher;
565
- private readonly ssaiService?;
119
+ export declare class AmazonIVSAdapter implements AdapterAPI {
120
+ private readonly internalAdapter;
121
+ private readonly analytics;
122
+ constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
123
+ private wrapPlayerLoad;
124
+ static readonly version: string;
566
125
  get version(): string;
567
- static version: string;
568
- private readonly adAnalytics;
569
- pageLoadTime: number;
570
- playerStartupTime: number;
571
- videoStartupTime: number;
572
- autoplay: boolean | undefined;
573
- sample: Sample;
574
- backend: Backend;
575
- errorDetailTrackingSettingsProvider: ErrorDetailTrackingSettingsProvider;
576
- private config;
577
- private droppedSampleFrames;
578
- private startupTime;
579
- private authenticationCallback;
580
- constructor(config: AnalyticsConfig, adapter: InternalAdapterAPI, backendFactory: BackendFactory, sessionHandler: SessionPersistenceHandler, featureManager: FeatureManager<FeatureConfigContainer>, onErrorDetailEventDispatcher: EventDispatcher<OnErrorDetailEventObject>, ssaiService?: SsaiService | undefined);
581
- get errorDetailSubscribable(): Subscribable<OnErrorDetailEventObject>;
582
- getPlayerInformationFromAdapter(): {
583
- player: string;
584
- version: string;
585
- playerTech: string;
586
- };
587
- init(): void;
588
- release(): void;
589
- setConfigParameters(): void;
590
- generateNewImpressionId(): void;
591
- setUserId(): void;
592
- setupStateMachineCallbacks(): void;
593
- guardAgainstMissingVideoTitle: (oldConfig: AnalyticsConfig, newConfig: AnalyticsConfig | undefined) => void;
594
- guardAgainstMissingIsLive: (oldConfig: AnalyticsConfig, newConfig: AnalyticsConfig | undefined) => void;
595
- sourceChange: (config: AnalyticsConfig | undefined) => void;
596
- setCustomDataOnce: (values: CustomDataValues) => void;
597
- setCustomData: (values: CustomDataValues) => void;
598
- getCurrentImpressionId: () => string | undefined;
599
- getUserId: () => string;
600
- setDuration(duration: number): void;
601
- setState(state: string): void;
602
- setPlaybackVideoPropertiesFromEvent(event: any): void;
603
- setPlaybackAudioPropertiesFromEvent(event: any): void;
604
- setPlaybackInfoFromAdapter(): void;
605
- setupSample(): Sample;
606
- sendAnalyticsRequest(): void;
607
- sendAnalyticsRequestAndClearValues(): void;
608
- sendUnloadRequest(): void;
609
- sendAnalyticsRequestSynchronous(): void;
610
- clearValues(): void;
611
- getIsLiveFromConfigOrPlaybackInfo(config: AnalyticsConfig, isLiveFromPlayback?: boolean): boolean;
612
- /**
613
- * This method sanitizes the input and updates the analytics config.
614
- * @param values Object containing the customData and other fields
615
- */
616
- private changeCustomData;
617
- private buildDefaultAnalyticsConfigValues;
618
- private checkForErrorsInConfig;
619
- private getDomainFromConfig;
620
- private createBackend;
621
- private getDomain;
622
- private setCompletionValues;
623
- private setVideoTimeStart;
624
- private setVideoTimeEnd;
625
- private sendQualityChange;
626
- static create(config: AnalyticsConfig, adapter: InternalAdapterAPI, ssaiService?: SsaiService): Analytics;
627
- }
628
- declare abstract class Adapter {
629
- protected analytics: Analytics;
630
- protected internalAdapter: InternalAdapterAPI;
631
126
  getCurrentImpressionId(): string | undefined;
632
127
  getUserId(): string | undefined;
633
128
  setCustomData(values: CustomDataValues): void;
634
129
  setCustomDataOnce(values: CustomDataValues): void;
635
130
  sourceChange(config: AnalyticsConfig): void;
636
- protected hasPlayerAlreadyBeenAugmented(player: any): boolean;
637
- protected markPlayerInstanceAsAugmented(player: any): void;
638
- protected guardAgainstNotInitializedAnalytics(): boolean;
639
131
  }
640
- export declare class AmazonIVSAdapter extends Adapter implements AdapterAPI {
641
- constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
642
- private wrapPlayerLoad;
643
- }
644
- export declare class Bitmovin8Adapter extends Adapter implements AdapterAPI {
132
+ export declare class Bitmovin8Adapter implements AdapterAPI {
133
+ private readonly internalAdapter;
134
+ private readonly analytics;
645
135
  constructor(player: any, opts?: AnalyticsStateMachineOptions);
646
- ssai: SsaiApi;
647
- /**
648
- * intercept `player.load` with automated sourceChange handling
649
- */
136
+ readonly ssai: SsaiApi;
650
137
  private wrapPlayerLoad;
138
+ static readonly version: string;
139
+ get version(): string;
140
+ getCurrentImpressionId(): string | undefined;
141
+ getUserId(): string | undefined;
142
+ setCustomData(values: CustomDataValues): void;
143
+ setCustomDataOnce(values: CustomDataValues): void;
144
+ sourceChange(config: AnalyticsConfig): void;
651
145
  }
652
146
  export declare const BitmovinPwxAnalyticsPackage: any;
653
- export declare class CAFv3Adapter extends Adapter implements AdapterAPI {
147
+ export declare class CAFv3Adapter implements AdapterAPI {
148
+ private readonly internalAdapter;
149
+ private readonly analytics;
654
150
  constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
151
+ static readonly version: string;
152
+ get version(): string;
153
+ getCurrentImpressionId(): string | undefined;
154
+ getUserId(): string | undefined;
155
+ setCustomData(values: CustomDataValues): void;
156
+ setCustomDataOnce(values: CustomDataValues): void;
157
+ sourceChange(config: AnalyticsConfig): void;
655
158
  }
656
- export declare class DashjsAdapter extends Adapter implements AdapterAPI {
159
+ export declare class DashjsAdapter implements AdapterAPI {
160
+ private readonly internalAdapter;
161
+ private readonly analytics;
657
162
  constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
163
+ static readonly version: string;
164
+ get version(): string;
165
+ getCurrentImpressionId(): string | undefined;
166
+ getUserId(): string | undefined;
167
+ setCustomData(values: CustomDataValues): void;
168
+ setCustomDataOnce(values: CustomDataValues): void;
169
+ sourceChange(config: AnalyticsConfig): void;
658
170
  }
659
- export declare class HlsAdapter extends Adapter implements AdapterAPI {
171
+ export declare class HlsAdapter implements AdapterAPI {
172
+ private readonly internalAdapter;
173
+ private readonly analytics;
660
174
  constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
175
+ static readonly version: string;
176
+ get version(): string;
177
+ getCurrentImpressionId(): string | undefined;
178
+ getUserId(): string | undefined;
179
+ setCustomData(values: CustomDataValues): void;
180
+ setCustomDataOnce(values: CustomDataValues): void;
181
+ sourceChange(config: AnalyticsConfig): void;
661
182
  }
662
- export declare class HTMLVideoElementAdapter extends Adapter implements AdapterAPI {
183
+ export declare class HTMLVideoElementAdapter implements AdapterAPI {
184
+ private readonly internalAdapter;
185
+ private readonly analytics;
663
186
  constructor(config: AnalyticsConfig, player: HTMLVideoElement, opts?: AnalyticsStateMachineOptions, sourceMetadata?: {
664
- streamFormat?: string;
665
187
  audioCodec?: string;
666
- videoCodec?: string;
667
188
  audioLanguage?: string;
189
+ streamFormat?: string;
190
+ videoCodec?: string;
668
191
  });
669
192
  get sessionMetadata(): {
670
193
  readonly setAudioLanguage: (audioLanguage: string) => void;
671
194
  readonly setSubtitleEnabled: (enabled: boolean) => void;
672
195
  readonly setSubtitleLanguage: (subtitleLanguage: string) => void;
673
196
  };
197
+ static readonly version: string;
198
+ get version(): string;
199
+ getCurrentImpressionId(): string | undefined;
200
+ getUserId(): string | undefined;
201
+ setCustomData(values: CustomDataValues): void;
202
+ setCustomDataOnce(values: CustomDataValues): void;
674
203
  sourceChange(config: AnalyticsConfig, sourceMetadata?: {
675
- streamFormat?: string;
676
204
  audioCodec?: string;
677
- videoCodec?: string;
678
205
  audioLanguage?: string;
206
+ streamFormat?: string;
207
+ videoCodec?: string;
679
208
  }): void;
680
209
  }
681
- export declare class ShakaAdapter extends Adapter implements AdapterAPI {
210
+ export declare class ShakaAdapter implements AdapterAPI {
211
+ private readonly internalAdapter;
212
+ private readonly analytics;
682
213
  constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
683
214
  private wrapPlayerLoad;
215
+ static readonly version: string;
216
+ get version(): string;
217
+ getCurrentImpressionId(): string | undefined;
218
+ getUserId(): string | undefined;
219
+ setCustomData(values: CustomDataValues): void;
220
+ setCustomDataOnce(values: CustomDataValues): void;
221
+ sourceChange(config: AnalyticsConfig): void;
684
222
  }
685
- export declare class VideojsAdapter extends Adapter implements AdapterAPI {
223
+ export declare class VideojsAdapter implements AdapterAPI {
224
+ private readonly internalAdapter;
225
+ private readonly analytics;
686
226
  constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
227
+ static readonly version: string;
228
+ get version(): string;
229
+ getCurrentImpressionId(): string | undefined;
230
+ getUserId(): string | undefined;
231
+ setCustomData(values: CustomDataValues): void;
232
+ setCustomDataOnce(values: CustomDataValues): void;
233
+ sourceChange(config: AnalyticsConfig): void;
687
234
  }
688
235
  declare enum CdnProvider {
689
- CLOUDFLARE = "cloudflare",
690
236
  AKAMAI = "akamai",
691
- FASTLY = "fastly",
692
- MAXCDN = "maxcdn",
693
- CLOUDFRONT = "cloudfront",
237
+ BITGRAVITY = "bitgravity",
694
238
  CHINACACHE = "chinacache",
695
- BITGRAVITY = "bitgravity"
239
+ CLOUDFLARE = "cloudflare",
240
+ CLOUDFRONT = "cloudfront",
241
+ FASTLY = "fastly",
242
+ MAXCDN = "maxcdn"
696
243
  }
697
244
  declare enum Player {
245
+ AMAZON_IVS = "amazonivs",
698
246
  BITMOVIN = "bitmovin",
699
247
  BITMOVIN_PWX = "bitmovin-pwx",
248
+ CHROMECAST_SHAKA = "chromecast-shaka",
249
+ DASHJS = "dashjs",
250
+ HLSJS = "hlsjs",
251
+ HTML5 = "html5",
700
252
  JW = "jw",
701
253
  RADIANT = "radiant",
702
- VIDEOJS = "videojs",
703
- HLSJS = "hlsjs",
704
254
  SHAKA = "shaka",
705
- DASHJS = "dashjs",
706
- HTML5 = "html5",
707
- CHROMECAST_SHAKA = "chromecast-shaka",
708
- AMAZON_IVS = "amazonivs"
255
+ VIDEOJS = "videojs"
709
256
  }
710
- /**
711
- * @see https://github.com/bitmovin-engineering/bitdash/blob/ccd3227dac82d1416a471711b40ee0f65d7f9ddb/src/ModuleDefinition.ts#L17
712
- */
713
257
  export declare const PlayerModule: {
714
258
  readonly name: "analytics";
715
259
  readonly module: {
@@ -719,6 +263,7 @@ export declare const PlayerModule: {
719
263
  readonly setup: (module: any, player: any) => Promise<any>;
720
264
  };
721
265
  };
266
+ declare const VERSION: string;
722
267
  export declare const adapters: {
723
268
  AmazonIVSAdapter: typeof AmazonIVSAdapter;
724
269
  Bitmovin8Adapter: typeof Bitmovin8Adapter;