bitmovin-analytics 2.32.4 → 2.33.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/README.md CHANGED
@@ -72,12 +72,12 @@ player.loadSource('https://path.to/your/stream.m3u8');
72
72
  player.attachMedia(document.getElementById('video'));
73
73
  ```
74
74
 
75
- Before changing the video source in the player, you need to call `sourceChange()` on the assotiated analytics adapter. You can pass new configuration properties to this method like `videoId` or `videoTitle`
75
+ Before changing the video source in the player, you need to call `sourceChange()` on the associated analytics adapter. You can pass new configuration properties to this method like `videoId` or `videoTitle`
76
76
 
77
77
  ```js
78
78
  analytics.sourceChange({
79
- videoID: 'new-video-id',
80
- videoTitle: 'New Video',
79
+ videoId: 'new-video-id',
80
+ title: 'New Video',
81
81
  });
82
82
 
83
83
  // Load the new source into player
@@ -1,5 +1,3 @@
1
-
2
-
3
1
  declare const VERSION: string;
4
2
  export interface AnalyticsDebugConfig {
5
3
  fields?: string[];
@@ -91,6 +89,9 @@ export interface CustomDataValues {
91
89
  customData30?: string;
92
90
  experimentName?: string;
93
91
  }
92
+ /**
93
+ * Minimal set of shared methods among all collectors
94
+ */
94
95
  export interface AdapterAPI {
95
96
  getCurrentImpressionId: () => string | undefined;
96
97
  getUserId: () => string | undefined;
@@ -275,7 +276,7 @@ export interface ErrorData {
275
276
  export interface AnalyticsEventBase {
276
277
  currentTime?: number;
277
278
  }
278
- export interface ErrorEvent extends AnalyticsEventBase {
279
+ interface ErrorEvent$1 extends AnalyticsEventBase {
279
280
  code: number | undefined;
280
281
  message: string | undefined;
281
282
  legacyData?: any;
@@ -360,11 +361,12 @@ export interface Sample extends CustomDataValues {
360
361
  videoWindowHeight?: number;
361
362
  videoWindowWidth?: number;
362
363
  }
364
+ export type HeartbeatPayload = Pick<Sample, "played"> | Pick<Sample, "buffered"> | Pick<Sample, "paused">;
363
365
  export interface StateMachineCallbacks {
364
366
  setup: (duration: number, state: string) => void;
365
367
  startup: (duration: number, state: string) => void;
366
368
  playing: (duration: number, state: string) => void;
367
- heartbeat: (duration: number, state: string, payload: Pick<Sample, "played"> | Pick<Sample, "buffered">) => void;
369
+ heartbeat: (duration: number, state: string, payload: HeartbeatPayload) => void;
368
370
  qualitychange: (duration: number, state: string) => void;
369
371
  qualitychange_pause: (duration: number, state: string) => void;
370
372
  qualitychange_rebuffering: (duration: number, state: string) => void;
@@ -375,15 +377,15 @@ export interface StateMachineCallbacks {
375
377
  paused_seeking: (duration: number, state: string) => void;
376
378
  end_play_seeking: (duration: number, state: string) => void;
377
379
  rebuffering: (duration: number, state: string) => void;
378
- error: (event: Readonly<ErrorEvent>) => void;
380
+ error: (event: Readonly<ErrorEvent$1>) => void;
379
381
  end: (duration: number, state: string) => void;
380
382
  unload: (duration: number, state: string) => void;
381
383
  ad: (duration: number, state: string) => void;
382
384
  mute: () => void;
383
385
  unMute: () => void;
384
386
  subtitle_changing: () => void;
385
- setVideoTimeEndFromEvent: (event: any) => void;
386
- setVideoTimeStartFromEvent: (event: any) => void;
387
+ setVideoTimeEndFromEvent: (event: AnalyticsEventBase | any) => void;
388
+ setVideoTimeStartFromEvent: (event: AnalyticsEventBase | any) => void;
387
389
  videoStartFailed: (event: Readonly<VideoStartFailedEvent>, sendRequest: boolean) => void;
388
390
  source_changing: (duration: number, state: string, event: any) => void;
389
391
  startCasting: (duration: number, event: any) => void;
@@ -569,7 +571,7 @@ declare abstract class Adapter {
569
571
  sourceChange(config: AnalyticsConfig): void;
570
572
  protected hasPlayerAlreadyBeenAugmented(player: any): boolean;
571
573
  protected markPlayerInstanceAsAugmented(player: any): void;
572
- private guardAgainstNotInitializedAnalytics;
574
+ protected guardAgainstNotInitializedAnalytics(): boolean;
573
575
  }
574
576
  export declare class AmazonIVSAdapter extends Adapter implements AdapterAPI {
575
577
  constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
@@ -577,6 +579,9 @@ export declare class AmazonIVSAdapter extends Adapter implements AdapterAPI {
577
579
  }
578
580
  export declare class Bitmovin8Adapter extends Adapter implements AdapterAPI {
579
581
  constructor(player: any, opts?: AnalyticsStateMachineOptions);
582
+ /**
583
+ * intercept `player.load` with automated sourceChange handling
584
+ */
580
585
  private wrapPlayerLoad;
581
586
  }
582
587
  export declare class CAFv3Adapter extends Adapter implements AdapterAPI {
@@ -585,12 +590,28 @@ export declare class CAFv3Adapter extends Adapter implements AdapterAPI {
585
590
  export declare class DashjsAdapter extends Adapter implements AdapterAPI {
586
591
  constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
587
592
  }
588
- export declare class HTMLVideoElementAdapter extends Adapter implements AdapterAPI {
589
- constructor(config: AnalyticsConfig, player: HTMLVideoElement, opts?: AnalyticsStateMachineOptions);
590
- }
591
593
  export declare class HlsAdapter extends Adapter implements AdapterAPI {
592
594
  constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
593
595
  }
596
+ export declare class HTMLVideoElementAdapter extends Adapter implements AdapterAPI {
597
+ constructor(config: AnalyticsConfig, player: HTMLVideoElement, opts?: AnalyticsStateMachineOptions, sourceMetadata?: {
598
+ streamFormat?: string;
599
+ audioCodec?: string;
600
+ videoCodec?: string;
601
+ audioLanguage?: string;
602
+ });
603
+ get sessionMetadata(): {
604
+ readonly setAudioLanguage: (audioLanguage: string) => void;
605
+ readonly setSubtitleEnabled: (enabled: boolean) => void;
606
+ readonly setSubtitleLanguage: (subtitleLanguage: string) => void;
607
+ };
608
+ sourceChange(config: AnalyticsConfig, sourceMetadata?: {
609
+ streamFormat?: string;
610
+ audioCodec?: string;
611
+ videoCodec?: string;
612
+ audioLanguage?: string;
613
+ }): void;
614
+ }
594
615
  export declare class ShakaAdapter extends Adapter implements AdapterAPI {
595
616
  constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
596
617
  private wrapPlayerLoad;
@@ -660,4 +681,3 @@ export {
660
681
  _default as default,
661
682
  };
662
683
 
663
- export {};