bitmovin-analytics 2.21.0 → 2.23.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.
Files changed (56) hide show
  1. package/bitmovinanalytics.min.js +2 -2
  2. package/bitmovinanalytics.min.js.map +1 -1
  3. package/js/adapters/Adapter.d.ts +2 -0
  4. package/js/adapters/Bitmovin7Adapter.d.ts +0 -2
  5. package/js/adapters/internal/Bitmovin7InternalAdapter.d.ts +6 -2
  6. package/js/adapters/internal/Bitmovin8HttpRequestTrackingAdapter.d.ts +12 -0
  7. package/js/adapters/internal/Bitmovin8InternalAdapter.d.ts +11 -6
  8. package/js/adapters/internal/Bitmovin8SegmentTrackerAdapter.d.ts +12 -1
  9. package/js/adapters/internal/CAFv3InternalAdapter.d.ts +6 -2
  10. package/js/adapters/internal/DashjsInternalAdapter.d.ts +5 -1
  11. package/js/adapters/internal/HTML5InternalAdapter.d.ts +7 -3
  12. package/js/adapters/internal/HlsInternalAdapter.d.ts +6 -2
  13. package/js/adapters/internal/InternalAdapter.d.ts +9 -6
  14. package/js/adapters/internal/InternalAdapterAPI.d.ts +5 -1
  15. package/js/adapters/internal/ShakaInternalAdapter.d.ts +5 -1
  16. package/js/adapters/internal/VideojsInternalAdapter.d.ts +6 -2
  17. package/js/analyticsStateMachines/AnalyticsStateMachine.d.ts +6 -3
  18. package/js/analyticsStateMachines/Bitmovin7AnalyticsStateMachine.d.ts +3 -1
  19. package/js/analyticsStateMachines/Bitmovin8AnalyticsStateMachine.d.ts +3 -1
  20. package/js/analyticsStateMachines/HTML5AnalyticsStateMachine.d.ts +3 -1
  21. package/js/analyticsStateMachines/VideoJsAnalyticsStateMachine.d.ts +3 -1
  22. package/js/core/Analytics.d.ts +15 -2
  23. package/js/core/BackendFactory.d.ts +2 -1
  24. package/js/core/EventDispatcher.d.ts +1 -1
  25. package/js/core/LicenseCheckingBackend.d.ts +4 -1
  26. package/js/core/Measure.d.ts +6 -6
  27. package/js/enums/ErrorCode.d.ts +9 -6
  28. package/js/enums/Event.d.ts +34 -0
  29. package/js/enums/VideoStartFailedReason.d.ts +9 -5
  30. package/js/features/Feature.d.ts +14 -0
  31. package/js/features/FeatureConfig.d.ts +3 -0
  32. package/js/features/FeatureManager.d.ts +9 -0
  33. package/js/features/errordetails/ErrorData.d.ts +5 -0
  34. package/js/features/errordetails/ErrorDetail.d.ts +18 -0
  35. package/js/features/errordetails/ErrorDetailBackend.d.ts +24 -0
  36. package/js/features/errordetails/ErrorDetailTracking.d.ts +28 -0
  37. package/js/features/errordetails/ErrorDetailTrackingConfig.d.ts +4 -0
  38. package/js/features/errordetails/OnErrorDetailEventObject.d.ts +6 -0
  39. package/js/features/httprequesttracking/HttpRequest.d.ts +24 -0
  40. package/js/features/httprequesttracking/HttpRequestTracking.d.ts +17 -0
  41. package/js/features/httprequesttracking/HttpRequestType.d.ts +24 -0
  42. package/js/features/httprequesttracking/OnDownloadFinishedEventObject.d.ts +4 -0
  43. package/js/types/AdAnalyticsSample.d.ts +21 -2
  44. package/js/types/AuthenticationCallback.d.ts +4 -0
  45. package/js/types/CustomDataValues.d.ts +22 -0
  46. package/js/types/EventData.d.ts +23 -8
  47. package/js/types/FeatureConfigContainer.d.ts +4 -0
  48. package/js/types/LicensingRequest.d.ts +2 -0
  49. package/js/types/NoExtraProperties.d.ts +5 -0
  50. package/js/types/Sample.d.ts +2 -9
  51. package/js/types/StateMachineCallbacks.d.ts +1 -0
  52. package/js/utils/CodecHelper.d.ts +1 -1
  53. package/js/utils/Queue.d.ts +9 -0
  54. package/js/utils/Utils.d.ts +2 -0
  55. package/package.json +1 -1
  56. package/js/types/ErrorEventObject.d.ts +0 -7
@@ -9,5 +9,7 @@ export declare abstract class Adapter {
9
9
  setCustomData(values: CustomDataValues): void;
10
10
  setCustomDataOnce(values: CustomDataValues): void;
11
11
  sourceChange(config: AnalyticsConfig): void;
12
+ protected hasPlayerAlreadyBeenAugmented(player: any): boolean;
13
+ protected markPlayerInstanceAsAugmented(player: any): void;
12
14
  private guardAgainstNotInitializedAnalytics;
13
15
  }
@@ -5,6 +5,4 @@ export declare class Bitmovin7Adapter extends Adapter implements AdapterAPI {
5
5
  constructor(player: any, opts?: AnalyticsStateMachineOptions);
6
6
  private augment;
7
7
  private wrapPlayerLoad;
8
- private hasPlayerAlreadyBeenAugmented;
9
- private markPlayerInstanceAsAugmented;
10
8
  }
@@ -1,6 +1,10 @@
1
+ import { Analytics } from '../../core/Analytics';
1
2
  import { Player } from '../../enums/Player';
3
+ import { Feature } from '../../features/Feature';
4
+ import { FeatureConfig } from '../../features/FeatureConfig';
2
5
  import { AnalyticsStateMachineOptions } from '../../types/AnalyticsStateMachineOptions';
3
6
  import { DrmPerformanceInfo } from '../../types/DrmPerformanceInfo';
7
+ import { FeatureConfigContainer } from '../../types/FeatureConfigContainer';
4
8
  import { PlaybackInfo } from '../../types/PlaybackInfo';
5
9
  import { InternalAdapter } from './InternalAdapter';
6
10
  import { InternalAdapterAPI } from './InternalAdapterAPI';
@@ -8,7 +12,7 @@ export declare class Bitmovin7InternalAdapter extends InternalAdapter implements
8
12
  private player;
9
13
  private onBeforeUnLoadEvent;
10
14
  constructor(player: any, opts?: AnalyticsStateMachineOptions);
11
- initialize(): void;
15
+ initialize(analytics: Analytics): Array<Feature<FeatureConfigContainer, FeatureConfig>>;
12
16
  getPlayerVersion: () => any;
13
17
  getPlayerName: () => Player;
14
18
  getPlayerTech: () => any;
@@ -17,7 +21,7 @@ export declare class Bitmovin7InternalAdapter extends InternalAdapter implements
17
21
  getCurrentPlaybackInfo(): PlaybackInfo;
18
22
  register(): void;
19
23
  sourceChange(config: any, timestamp: number): void;
20
- protected readonly currentTime: number;
24
+ protected get currentTime(): number;
21
25
  private applySourceProperties;
22
26
  private applySubtitleProperties;
23
27
  private applyPlaybackQualityProperties;
@@ -0,0 +1,12 @@
1
+ import { PlayerAPI } from 'bitmovin-player';
2
+ import { Subscribable } from '../../core/EventDispatcher';
3
+ import { OnDownloadFinishedEventObject } from '../../features/httprequesttracking/OnDownloadFinishedEventObject';
4
+ export declare class Bitmovin8HttpRequestTrackingAdapter implements Subscribable<OnDownloadFinishedEventObject> {
5
+ private eventDispatcher;
6
+ private playerExports;
7
+ constructor(player: PlayerAPI);
8
+ subscribe(callback: (args: OnDownloadFinishedEventObject) => void): () => void;
9
+ unsubscribe(callback: (args: OnDownloadFinishedEventObject) => void): void;
10
+ private onDownloadFinished;
11
+ private mapHttpRequestType;
12
+ }
@@ -1,9 +1,13 @@
1
1
  import { PlayerAPI } from 'bitmovin-player';
2
+ import { Analytics } from '../../core/Analytics';
2
3
  import VideoCompletionTracker from '../../core/VideoCompletionTracker';
3
4
  import { Player } from '../../enums/Player';
5
+ import { Feature } from '../../features/Feature';
6
+ import { FeatureConfig } from '../../features/FeatureConfig';
4
7
  import { AnalyticsStateMachineOptions } from '../../types/AnalyticsStateMachineOptions';
5
8
  import { DownloadSpeedInfo } from '../../types/DownloadSpeedInfo';
6
9
  import { DrmPerformanceInfo } from '../../types/DrmPerformanceInfo';
10
+ import { FeatureConfigContainer } from '../../types/FeatureConfigContainer';
7
11
  import { PlaybackInfo } from '../../types/PlaybackInfo';
8
12
  import { SegmentInfo } from '../../types/SegmentInfo';
9
13
  import { AdModuleAPI } from './ads/AdModuleAPI';
@@ -11,19 +15,20 @@ import { InternalAdapter } from './InternalAdapter';
11
15
  import { InternalAdapterAPI } from './InternalAdapterAPI';
12
16
  export declare class Bitmovin8InternalAdapter extends InternalAdapter implements InternalAdapterAPI {
13
17
  private player;
14
- readonly downloadSpeedInfo: DownloadSpeedInfo;
15
- readonly segments: SegmentInfo[];
16
- readonly adModule: AdModuleAPI | undefined;
17
- readonly supportsDeferredLicenseLoading: boolean;
18
+ get downloadSpeedInfo(): DownloadSpeedInfo;
19
+ get segments(): SegmentInfo[];
20
+ get adModule(): AdModuleAPI | undefined;
21
+ get supportsDeferredLicenseLoading(): boolean;
18
22
  readonly videoCompletionTracker: VideoCompletionTracker;
19
23
  private onBeforeUnLoadEvent;
20
24
  private speedMeter;
21
25
  private segmentTracker;
22
26
  private _adModule?;
23
27
  private lastTrackedCurrentTime;
28
+ private httpRequestTrackingAdapter;
24
29
  constructor(player: PlayerAPI, opts?: AnalyticsStateMachineOptions);
25
- protected readonly currentTime: number;
26
- initialize(): void;
30
+ protected get currentTime(): number;
31
+ initialize(analytics: Analytics): Array<Feature<FeatureConfigContainer, FeatureConfig>>;
27
32
  clearValues(): void;
28
33
  clearSegments(): void;
29
34
  getPlayerVersion: () => string;
@@ -10,11 +10,22 @@ interface DownloadFinishedEvent {
10
10
  type: string;
11
11
  url: string;
12
12
  }
13
+ interface SegmentPlaybackEvent {
14
+ duration?: number;
15
+ mediaInfo?: any;
16
+ mimeType?: string;
17
+ playbackTime?: number;
18
+ representationId?: string;
19
+ timestamp?: number;
20
+ type?: string;
21
+ uid?: string;
22
+ url?: string;
23
+ }
13
24
  export declare class Bitmovin8SegmentTrackerAdapter {
14
25
  private segmentTracker;
15
26
  constructor(player: PlayerAPI, segmentTracker: SegmentTracker);
16
27
  getSegmentTracker(): SegmentTracker;
17
28
  handleOnDownloadFinishEvent(event: DownloadFinishedEvent & any): void;
18
- handleSegmentPlaybackEvent: (event: any) => void;
29
+ handleSegmentPlaybackEvent: (event: SegmentPlaybackEvent & any) => void;
19
30
  }
20
31
  export {};
@@ -1,6 +1,10 @@
1
+ import { Analytics } from '../../core/Analytics';
1
2
  import { Player } from '../../enums/Player';
3
+ import { Feature } from '../../features/Feature';
4
+ import { FeatureConfig } from '../../features/FeatureConfig';
2
5
  import { AnalyticsStateMachineOptions } from '../../types/AnalyticsStateMachineOptions';
3
6
  import { DrmPerformanceInfo } from '../../types/DrmPerformanceInfo';
7
+ import { FeatureConfigContainer } from '../../types/FeatureConfigContainer';
4
8
  import { PlaybackInfo } from '../../types/PlaybackInfo';
5
9
  import { InternalAdapter } from './InternalAdapter';
6
10
  import { InternalAdapterAPI } from './InternalAdapterAPI';
@@ -13,7 +17,7 @@ export declare class CAFv3InternalAdapter extends InternalAdapter implements Int
13
17
  private currentItem;
14
18
  private isSeeking;
15
19
  constructor(context: any, opts?: AnalyticsStateMachineOptions);
16
- initialize(): void;
20
+ initialize(analytics: Analytics): Array<Feature<FeatureConfigContainer, FeatureConfig>>;
17
21
  getPlayerVersion(): string;
18
22
  getPlayerName: () => Player;
19
23
  getPlayerTech: () => string;
@@ -23,5 +27,5 @@ export declare class CAFv3InternalAdapter extends InternalAdapter implements Int
23
27
  getCurrentPlaybackInfo(): PlaybackInfo;
24
28
  register(): void;
25
29
  onPaused(currentTime?: number): void;
26
- protected readonly currentTime: number;
30
+ protected get currentTime(): number;
27
31
  }
@@ -1,5 +1,9 @@
1
+ import { Analytics } from '../../core/Analytics';
1
2
  import { Player } from '../../enums/Player';
3
+ import { Feature } from '../../features/Feature';
4
+ import { FeatureConfig } from '../../features/FeatureConfig';
2
5
  import { AnalyticsStateMachineOptions } from '../../types/AnalyticsStateMachineOptions';
6
+ import { FeatureConfigContainer } from '../../types/FeatureConfigContainer';
3
7
  import { QualityLevelInfo } from '../../types/QualityLevelInfo';
4
8
  import { HTML5InternalAdapter } from './HTML5InternalAdapter';
5
9
  import { InternalAdapterAPI } from './InternalAdapterAPI';
@@ -9,7 +13,7 @@ export declare class DashjsInternalAdapter extends HTML5InternalAdapter implemen
9
13
  /**
10
14
  * @override
11
15
  */
12
- initialize(): void;
16
+ initialize(analytics: Analytics): Array<Feature<FeatureConfigContainer, FeatureConfig>>;
13
17
  registerMediaElementEventsForDashJS(): void;
14
18
  getPlayerName: () => Player;
15
19
  getPlayerVersion: () => any;
@@ -1,7 +1,11 @@
1
+ import { Analytics } from '../../core/Analytics';
1
2
  import VideoCompletionTracker from '../../core/VideoCompletionTracker';
2
3
  import { Player } from '../../enums/Player';
4
+ import { Feature } from '../../features/Feature';
5
+ import { FeatureConfig } from '../../features/FeatureConfig';
3
6
  import { AnalyticsStateMachineOptions } from '../../types/AnalyticsStateMachineOptions';
4
7
  import { DrmPerformanceInfo } from '../../types/DrmPerformanceInfo';
8
+ import { FeatureConfigContainer } from '../../types/FeatureConfigContainer';
5
9
  import { PlaybackInfo } from '../../types/PlaybackInfo';
6
10
  import { QualityLevelInfo } from '../../types/QualityLevelInfo';
7
11
  import { SegmentInfo } from '../../types/SegmentInfo';
@@ -11,7 +15,7 @@ import { InternalAdapter } from './InternalAdapter';
11
15
  import { InternalAdapterAPI } from './InternalAdapterAPI';
12
16
  export declare abstract class HTML5InternalAdapter extends InternalAdapter implements InternalAdapterAPI {
13
17
  protected mediaElement: HTMLVideoElement | null;
14
- readonly segments: SegmentInfo[];
18
+ get segments(): SegmentInfo[];
15
19
  private static BUFFERING_TIMECHANGED_TIMEOUT;
16
20
  mediaElEventHandlers: Array<{
17
21
  event: string;
@@ -35,11 +39,11 @@ export declare abstract class HTML5InternalAdapter extends InternalAdapter imple
35
39
  getPlayerTech: () => string;
36
40
  getAutoPlay: () => boolean;
37
41
  getDrmPerformanceInfo: () => DrmPerformanceInfo | undefined;
38
- initialize(): void;
42
+ initialize(analytics: Analytics): Array<Feature<FeatureConfigContainer, FeatureConfig>>;
39
43
  isLive: () => boolean;
40
44
  getStreamSources(url: string | undefined): StreamSources;
41
45
  getCurrentPlaybackInfo(): PlaybackInfo;
42
- protected readonly currentTime: number;
46
+ protected get currentTime(): number;
43
47
  /**
44
48
  * Used to setup against the media element.
45
49
  * We need this method to desynchronize construction of this class
@@ -1,17 +1,21 @@
1
1
  /// <reference types="hls.js" />
2
+ import { Analytics } from '../../core/Analytics';
2
3
  import { Player } from '../../enums/Player';
4
+ import { Feature } from '../../features/Feature';
5
+ import { FeatureConfig } from '../../features/FeatureConfig';
3
6
  import { AnalyticsStateMachineOptions } from '../../types/AnalyticsStateMachineOptions';
4
7
  import { DownloadSpeedInfo } from '../../types/DownloadSpeedInfo';
8
+ import { FeatureConfigContainer } from '../../types/FeatureConfigContainer';
5
9
  import { PlaybackInfo } from '../../types/PlaybackInfo';
6
10
  import { QualityLevelInfo } from '../../types/QualityLevelInfo';
7
11
  import { HTML5InternalAdapter } from './HTML5InternalAdapter';
8
12
  import { InternalAdapterAPI } from './InternalAdapterAPI';
9
13
  export declare class HlsInternalAdapter extends HTML5InternalAdapter implements InternalAdapterAPI {
10
14
  private hls;
11
- readonly downloadSpeedInfo: DownloadSpeedInfo;
15
+ get downloadSpeedInfo(): DownloadSpeedInfo;
12
16
  private speedMeter;
13
17
  constructor(hls: Hls, opts?: AnalyticsStateMachineOptions);
14
- initialize(): void;
18
+ initialize(analytics: Analytics): Array<Feature<FeatureConfigContainer, FeatureConfig>>;
15
19
  clearValues(): void;
16
20
  getPlayerName: () => Player;
17
21
  getPlayerVersion: () => any;
@@ -1,9 +1,11 @@
1
1
  import { AnalyticsStateMachine } from '../../analyticsStateMachines/AnalyticsStateMachine';
2
2
  import { EventDispatcher } from '../../core/EventDispatcher';
3
+ import { Event, EventMap } from '../../enums/Event';
3
4
  import { AnalyticsStateMachineOptions } from '../../types/AnalyticsStateMachineOptions';
4
5
  import { CustomDataValues } from '../../types/CustomDataValues';
5
6
  import { DownloadSpeedInfo } from '../../types/DownloadSpeedInfo';
6
7
  import { DrmPerformanceInfo } from '../../types/DrmPerformanceInfo';
8
+ import { NoExtraProperties } from '../../types/NoExtraProperties';
7
9
  import { SegmentInfo } from '../../types/SegmentInfo';
8
10
  import { StateMachineCallbacks } from '../../types/StateMachineCallbacks';
9
11
  export declare abstract class InternalAdapter {
@@ -18,15 +20,16 @@ export declare abstract class InternalAdapter {
18
20
  protected previousVideoBitrate: number;
19
21
  protected previousAudioBitrate: number;
20
22
  protected qualityChangeCount: number;
21
- protected abstract readonly currentTime: number;
22
- readonly onLicenseKeyReceived: EventDispatcher<{
23
+ protected abstract get currentTime(): number;
24
+ get onLicenseKeyReceived(): EventDispatcher<{
23
25
  licenseKey: string;
24
26
  }>;
25
- readonly onLicenseCallFailed: EventDispatcher<{}>;
26
- readonly downloadSpeedInfo: DownloadSpeedInfo;
27
- readonly segments: SegmentInfo[];
27
+ get onLicenseCallFailed(): EventDispatcher<{}>;
28
+ get downloadSpeedInfo(): DownloadSpeedInfo;
29
+ get segments(): SegmentInfo[];
28
30
  constructor(opts?: AnalyticsStateMachineOptions);
29
- eventCallback: (eventType: string, eventObject: any) => void;
31
+ release(): void;
32
+ eventCallback: <StatemachineEvent extends Event, EventData extends EventMap[StatemachineEvent]>(eventType: StatemachineEvent, eventObject: NoExtraProperties<EventMap[StatemachineEvent], EventData>) => void;
30
33
  getCommonPlaybackInfo(): {
31
34
  screenHeight: number;
32
35
  screenWidth: number;
@@ -1,7 +1,11 @@
1
+ import { Analytics } from '../../core/Analytics';
1
2
  import VideoCompletionTracker from '../../core/VideoCompletionTracker';
3
+ import { Feature } from '../../features/Feature';
4
+ import { FeatureConfig } from '../../features/FeatureConfig';
2
5
  import { CustomDataValues } from '../../types/CustomDataValues';
3
6
  import { DownloadSpeedInfo } from '../../types/DownloadSpeedInfo';
4
7
  import { DrmPerformanceInfo } from '../../types/DrmPerformanceInfo';
8
+ import { FeatureConfigContainer } from '../../types/FeatureConfigContainer';
5
9
  import { PlaybackInfo } from '../../types/PlaybackInfo';
6
10
  import { SegmentInfo } from '../../types/SegmentInfo';
7
11
  import { StateMachineCallbacks } from '../../types/StateMachineCallbacks';
@@ -21,7 +25,7 @@ export interface InternalAdapterAPI extends DeferredLicenseLoadingAdapterAPI {
21
25
  getPlayerTech(): string;
22
26
  getAutoPlay(): boolean;
23
27
  getDrmPerformanceInfo(): DrmPerformanceInfo | undefined;
24
- initialize(): void;
28
+ initialize(analytics: Analytics): Array<Feature<FeatureConfigContainer, FeatureConfig>>;
25
29
  getCurrentPlaybackInfo(): PlaybackInfo;
26
30
  sourceChange(config: any, timestamp: number): any;
27
31
  clearValues(): void;
@@ -1,5 +1,9 @@
1
+ import { Analytics } from '../../core/Analytics';
1
2
  import { Player } from '../../enums/Player';
3
+ import { Feature } from '../../features/Feature';
4
+ import { FeatureConfig } from '../../features/FeatureConfig';
2
5
  import { AnalyticsStateMachineOptions } from '../../types/AnalyticsStateMachineOptions';
6
+ import { FeatureConfigContainer } from '../../types/FeatureConfigContainer';
3
7
  import { QualityLevelInfo } from '../../types/QualityLevelInfo';
4
8
  import { HTML5InternalAdapter } from './HTML5InternalAdapter';
5
9
  import { InternalAdapterAPI } from './InternalAdapterAPI';
@@ -9,7 +13,7 @@ export declare class ShakaInternalAdapter extends HTML5InternalAdapter implement
9
13
  /**
10
14
  * @override
11
15
  */
12
- initialize(): void;
16
+ initialize(analytics: Analytics): Array<Feature<FeatureConfigContainer, FeatureConfig>>;
13
17
  getPlayerName: () => Player;
14
18
  getPlayerVersion: () => any;
15
19
  isLive: () => any;
@@ -1,8 +1,12 @@
1
1
  /// <reference types="video.js" />
2
+ import { Analytics } from '../../core/Analytics';
2
3
  import VideoCompletionTracker from '../../core/VideoCompletionTracker';
3
4
  import { Player } from '../../enums/Player';
5
+ import { Feature } from '../../features/Feature';
6
+ import { FeatureConfig } from '../../features/FeatureConfig';
4
7
  import { AnalyticsStateMachineOptions } from '../../types/AnalyticsStateMachineOptions';
5
8
  import { DrmPerformanceInfo } from '../../types/DrmPerformanceInfo';
9
+ import { FeatureConfigContainer } from '../../types/FeatureConfigContainer';
6
10
  import { PlaybackInfo } from '../../types/PlaybackInfo';
7
11
  import { QualityLevelInfo } from '../../types/QualityLevelInfo';
8
12
  import { StreamSources } from '../../types/StreamSources';
@@ -16,7 +20,7 @@ export declare class VideojsInternalAdapter extends InternalAdapter implements I
16
20
  private onBeforeUnLoadEvent;
17
21
  private previousTime;
18
22
  constructor(player: videojs.default.Player, opts?: AnalyticsStateMachineOptions);
19
- initialize(): void;
23
+ initialize(analytics: Analytics): Array<Feature<FeatureConfigContainer, FeatureConfig>>;
20
24
  getPlayerVersion: () => any;
21
25
  getPlayerName: () => Player;
22
26
  getPlayerTech: () => string;
@@ -28,7 +32,7 @@ export declare class VideojsInternalAdapter extends InternalAdapter implements I
28
32
  getCurrentQualityLevelInfo(): QualityLevelInfo | null;
29
33
  register(): void;
30
34
  sourceChange(config: any, timestamp: number): void;
31
- protected readonly currentTime: number;
35
+ protected get currentTime(): number;
32
36
  private getSelectedAudioTrackLanguage;
33
37
  private getSubtitleInfo;
34
38
  }
@@ -1,6 +1,8 @@
1
+ import { EventMap } from '../enums/Event';
1
2
  import { VideoStartFailedReason } from '../enums/VideoStartFailedReason';
2
3
  import { AnalyticsStateMachineOptions } from '../types/AnalyticsStateMachineOptions';
3
4
  import * as ErrorData from '../types/EventData';
5
+ import { NoExtraProperties } from '../types/NoExtraProperties';
4
6
  import { StateMachineCallbacks } from '../types/StateMachineCallbacks';
5
7
  export declare abstract class AnalyticsStateMachine {
6
8
  protected stateMachineCallbacks: StateMachineCallbacks;
@@ -16,15 +18,16 @@ export declare abstract class AnalyticsStateMachine {
16
18
  private videoStartTimeout?;
17
19
  constructor(stateMachineCallbacks: StateMachineCallbacks, opts: AnalyticsStateMachineOptions);
18
20
  abstract createStateMachine(opts: AnalyticsStateMachineOptions): StateMachine.StateMachine;
19
- abstract callEvent(eventType: string, eventObject: any, timestamp: number): void;
21
+ abstract callEvent<StatemachineEvent extends keyof EventMap, EventData extends EventMap[StatemachineEvent]>(eventType: StatemachineEvent, eventObject: NoExtraProperties<EventMap[StatemachineEvent], EventData>, timestamp: number): void;
20
22
  abstract sourceChange(config: any, timestamp: number, currentTime?: number): void;
21
- readonly currentState: string;
23
+ get currentState(): string;
24
+ resetIntervals(): void;
22
25
  protected startRebufferingHeartbeatInterval(reset?: boolean): void;
23
26
  protected resetRebufferingHelpers(reset?: boolean): void;
24
27
  protected clearRebufferingHeartbeatHandle(): void;
25
28
  protected startRebufferingTimeoutHandle(): void;
26
29
  protected clearRebufferingTimeoutHandle(reset: boolean): void;
27
- protected getVideoStartupFailedEventData(timestamp: number, event?: string, errorData?: any): ErrorData.VideoStartFailedEvent;
30
+ protected getVideoStartupFailedEventData(currentTime: number, event?: string, eventObject?: any): ErrorData.VideoStartFailedEvent;
28
31
  protected getReasonForVideoStartFailure(event?: string): VideoStartFailedReason;
29
32
  protected setVideoStartTimeout(): void;
30
33
  protected clearVideoStartTimeout(): void;
@@ -1,5 +1,7 @@
1
1
  import * as StateMachine from 'javascript-state-machine';
2
+ import { EventMap } from '../enums/Event';
2
3
  import { AnalyticsStateMachineOptions } from '../types/AnalyticsStateMachineOptions';
4
+ import { NoExtraProperties } from '../types/NoExtraProperties';
3
5
  import { StateMachineCallbacks } from '../types/StateMachineCallbacks';
4
6
  import { EventDebugging } from '../utils/EventDebugging';
5
7
  import { AnalyticsStateMachine } from './AnalyticsStateMachine';
@@ -18,7 +20,7 @@ export declare class Bitmovin7AnalyticsStateMachine extends AnalyticsStateMachin
18
20
  getAllStates(): any[];
19
21
  sourceChange: (config: any, timestamp: number, currentTime?: number | undefined) => void;
20
22
  createStateMachine(opts: AnalyticsStateMachineOptions): StateMachine.StateMachine;
21
- callEvent(eventType: string, eventObject: any, timestamp: number): void;
23
+ callEvent<StatemachineEvent extends keyof EventMap, EventData extends EventMap[StatemachineEvent]>(eventType: StatemachineEvent, eventObject: NoExtraProperties<EventMap[StatemachineEvent], EventData>, timestamp: number): void;
22
24
  addStatesToLog(event: string | undefined, from: string | undefined, to: string | undefined, timestamp: number, eventObject: any): void;
23
25
  getStates(): EventDebugging[];
24
26
  setEnabledDebugging(enabled: boolean): void;
@@ -1,5 +1,7 @@
1
1
  import * as StateMachine from 'javascript-state-machine';
2
+ import { EventMap } from '../enums/Event';
2
3
  import { AnalyticsStateMachineOptions } from '../types/AnalyticsStateMachineOptions';
4
+ import { NoExtraProperties } from '../types/NoExtraProperties';
3
5
  import { StateMachineCallbacks } from '../types/StateMachineCallbacks';
4
6
  import { EventDebugging } from '../utils/EventDebugging';
5
7
  import { AnalyticsStateMachine } from './AnalyticsStateMachine';
@@ -15,7 +17,7 @@ export declare class Bitmovin8AnalyticsStateMachine extends AnalyticsStateMachin
15
17
  getAllStates(): any[];
16
18
  sourceChange: (config: any, timestamp: number, currentTime?: number | undefined) => void;
17
19
  createStateMachine(opts: AnalyticsStateMachineOptions): StateMachine.StateMachine;
18
- callEvent(eventType: string, eventObject: any, timestamp: number): void;
20
+ callEvent<StatemachineEvent extends keyof EventMap, EventData extends EventMap[StatemachineEvent]>(eventType: StatemachineEvent, eventObject: NoExtraProperties<EventMap[StatemachineEvent], EventData>, timestamp: number): void;
19
21
  addStatesToLog(event: string | undefined, from: string | undefined, to: string | undefined, timestamp: number, eventObject: any): void;
20
22
  getStates(): EventDebugging[];
21
23
  setEnabledDebugging(enabled: boolean): void;
@@ -1,5 +1,7 @@
1
1
  import * as StateMachine from 'javascript-state-machine';
2
+ import { EventMap } from '../enums/Event';
2
3
  import { AnalyticsStateMachineOptions } from '../types/AnalyticsStateMachineOptions';
4
+ import { NoExtraProperties } from '../types/NoExtraProperties';
3
5
  import { StateMachineCallbacks } from '../types/StateMachineCallbacks';
4
6
  import { AnalyticsStateMachine } from './AnalyticsStateMachine';
5
7
  export declare class HTML5AnalyticsStateMachine extends AnalyticsStateMachine {
@@ -8,6 +10,6 @@ export declare class HTML5AnalyticsStateMachine extends AnalyticsStateMachine {
8
10
  getAllStates(): any[];
9
11
  getAllStatesBut(states: string[]): any[];
10
12
  createStateMachine(opts: AnalyticsStateMachineOptions): StateMachine.StateMachine;
11
- callEvent(eventType: string, eventObject: any, timestamp: number): void;
13
+ callEvent<StatemachineEvent extends keyof EventMap, EventData extends EventMap[StatemachineEvent]>(eventType: StatemachineEvent, eventObject: NoExtraProperties<EventMap[StatemachineEvent], EventData>, timestamp: number): void;
12
14
  sourceChange: (config: any, timestamp: number, currentTime?: number | undefined) => void;
13
15
  }
@@ -1,5 +1,7 @@
1
1
  import * as StateMachine from 'javascript-state-machine';
2
+ import { EventMap } from '../enums/Event';
2
3
  import { AnalyticsStateMachineOptions } from '../types/AnalyticsStateMachineOptions';
4
+ import { NoExtraProperties } from '../types/NoExtraProperties';
3
5
  import { StateMachineCallbacks } from '../types/StateMachineCallbacks';
4
6
  import { AnalyticsStateMachine } from './AnalyticsStateMachine';
5
7
  export declare class VideojsAnalyticsStateMachine extends AnalyticsStateMachine {
@@ -10,6 +12,6 @@ export declare class VideojsAnalyticsStateMachine extends AnalyticsStateMachine
10
12
  getAllStates(): any[];
11
13
  getAllStatesBut(state: string): any[];
12
14
  createStateMachine(opts: AnalyticsStateMachineOptions): StateMachine.StateMachine;
13
- callEvent(eventType: string, eventObject: any, timestamp: number): void;
15
+ callEvent<StatemachineEvent extends keyof EventMap, EventData extends EventMap[StatemachineEvent]>(eventType: StatemachineEvent, eventObject: NoExtraProperties<EventMap[StatemachineEvent], EventData>, timestamp: number): void;
14
16
  sourceChange: (config: any, timestamp: number, currentTime?: number | undefined) => void;
15
17
  }
@@ -1,12 +1,15 @@
1
1
  import { InternalAdapterAPI } from '../adapters/internal/InternalAdapterAPI';
2
+ import { ErrorDetailTrackingSettingsProvider } from '../features/errordetails/ErrorDetailTracking';
3
+ import { OnErrorDetailEventObject } from '../features/errordetails/OnErrorDetailEventObject';
2
4
  import { AnalyticsConfig } from '../types/AnalyticsConfig';
3
5
  import { CastClientConfig } from '../types/CastClientConfig';
4
6
  import { CustomDataValues } from '../types/CustomDataValues';
5
7
  import { Sample } from '../types/Sample';
6
8
  import { Backend } from './Backend';
7
9
  import { BackendFactory } from './BackendFactory';
10
+ import { Subscribable } from './EventDispatcher';
8
11
  export declare class Analytics {
9
- readonly version: string;
12
+ get version(): string;
10
13
  static version: string;
11
14
  static LICENSE_CALL_PENDING_TIMEOUT: number;
12
15
  static PAGE_LOAD_TYPE_TIMEOUT: number;
@@ -17,6 +20,8 @@ export declare class Analytics {
17
20
  autoplay: boolean | undefined;
18
21
  sample: Sample;
19
22
  backend: Backend;
23
+ errorDetailTrackingSettingsProvider: ErrorDetailTrackingSettingsProvider;
24
+ get errorDetailSubscribable(): Subscribable<OnErrorDetailEventObject>;
20
25
  private config;
21
26
  private sessionHandler;
22
27
  private droppedSampleFrames;
@@ -24,6 +29,9 @@ export declare class Analytics {
24
29
  private adapter;
25
30
  private backendFactory;
26
31
  private resetQualityChangeCountIntervalId?;
32
+ private featureManager;
33
+ private onErrorDetailEventDispatcher;
34
+ private authenticationCallback;
27
35
  constructor(config: AnalyticsConfig, adapter: InternalAdapterAPI, backendFactory?: BackendFactory);
28
36
  getPlayerInformationFromAdapter(): {
29
37
  player: string;
@@ -58,12 +66,17 @@ export declare class Analytics {
58
66
  getIsLiveFromConfigOrPlaybackInfo(config: AnalyticsConfig, isLiveFromPlayback?: boolean): boolean;
59
67
  getMergedCollectorConfig(newConfig: AnalyticsConfig, oldConfig?: AnalyticsConfig): import("../types/AnalyticsConfig").CollectorConfig | undefined;
60
68
  getMergedAnalyticsConfig(newConfig: AnalyticsConfig, oldConfig?: AnalyticsConfig): AnalyticsConfig;
69
+ /**
70
+ * This method sanitizes the input and updates the analytics config.
71
+ * @param values Object containing the customData and other fields
72
+ */
61
73
  private changeCustomData;
62
74
  private buildDefaultAnalyticsConfigValues;
63
75
  private checkForErrorsInConfig;
64
76
  private getDomainFromConfig;
65
77
  private createBackend;
78
+ private getDomain;
66
79
  private setCompletionValues;
67
80
  private sendQualityChange;
68
- private clearResetQualityChangeIntverval;
81
+ private clearResetQualityChangeInterval;
69
82
  }
@@ -1,9 +1,10 @@
1
1
  import { DeferredLicenseLoadingAdapterAPI } from '../adapters/internal/DeferredLicenseLoadingAdapterAPI';
2
2
  import { AnalyticsConfig } from '../types/AnalyticsConfig';
3
+ import { AuthenticationCallback } from '../types/AuthenticationCallback';
3
4
  import { LicensingRequest } from '../types/LicensingRequest';
4
5
  import { Backend } from './Backend';
5
6
  export declare class BackendFactory {
6
- createBackend(analyticsConfig: AnalyticsConfig, licensingRequest: LicensingRequest, adapter: DeferredLicenseLoadingAdapterAPI): Backend;
7
+ createBackend(analyticsConfig: AnalyticsConfig, licensingRequest: LicensingRequest, adapter: DeferredLicenseLoadingAdapterAPI, authenticationCallback: AuthenticationCallback): Backend;
7
8
  private decorateWithDebuggingBackend;
8
9
  private decorateWithBackendFromConfigIfAvailable;
9
10
  private isEnabled;
@@ -8,6 +8,6 @@ export declare class EventDispatcher<TArgs> implements Subscribable<TArgs> {
8
8
  subscribe(callback: EventHandler<TArgs>): () => void;
9
9
  dispatch(args: TArgs): void;
10
10
  unsubscribe(callback: EventHandler<TArgs>): void;
11
- readonly subscriberCount: number;
11
+ get subscriberCount(): number;
12
12
  }
13
13
  export {};
@@ -2,6 +2,7 @@ import { DeferredLicenseLoadingAdapterAPI } from '../adapters/internal/DeferredL
2
2
  import { AdAnalyticsSample } from '../types/AdAnalyticsSample';
3
3
  import { AdBreakSample } from '../types/AdBreakSample';
4
4
  import { AdSample } from '../types/AdSample';
5
+ import { AuthenticationCallback } from '../types/AuthenticationCallback';
5
6
  import { LicenseCallFunc, LicensingRequest, LicensingResponse } from '../types/LicensingRequest';
6
7
  import { Sample } from '../types/Sample';
7
8
  import { Backend } from './Backend';
@@ -9,11 +10,12 @@ export declare class LicenseCheckingBackend implements Backend {
9
10
  private licenseCall;
10
11
  private backendBaseUrl;
11
12
  private adapter;
13
+ private authenticationCallback;
12
14
  promise?: Promise<LicensingResponse>;
13
15
  private licenseLazyLoadingTimeoutHandle?;
14
16
  private backend;
15
17
  private info;
16
- constructor(info: LicensingRequest, licenseCall: LicenseCallFunc, backendBaseUrl: string, adapter: DeferredLicenseLoadingAdapterAPI);
18
+ constructor(info: LicensingRequest, licenseCall: LicenseCallFunc, backendBaseUrl: string, adapter: DeferredLicenseLoadingAdapterAPI, authenticationCallback: AuthenticationCallback);
17
19
  performLicenseCheck(): Promise<LicensingResponse>;
18
20
  sendRequest(sample: Sample): void;
19
21
  sendUnloadRequest(sample: Sample): void;
@@ -23,4 +25,5 @@ export declare class LicenseCheckingBackend implements Backend {
23
25
  private licenseCallFailed;
24
26
  private licenseLazyLoadingTimeout;
25
27
  private unsubscribeFromAdapter;
28
+ private wrapLicenseCheckPromiseWithCallback;
26
29
  }
@@ -1,11 +1,11 @@
1
1
  import { SpeedMeasurement } from '../types/SpeedMeasurement';
2
2
  export declare class Measure implements SpeedMeasurement {
3
3
  private download;
4
- readonly speed: number;
5
- readonly duration: number;
6
- readonly size: number;
7
- readonly timeToFirstByte: number;
8
- readonly timestamp: Date;
9
- readonly httpStatus: number;
4
+ get speed(): number;
5
+ get duration(): number;
6
+ get size(): number;
7
+ get timeToFirstByte(): number;
8
+ get timestamp(): Date;
9
+ get httpStatus(): number;
10
10
  constructor(download: SpeedMeasurement);
11
11
  }
@@ -1,7 +1,10 @@
1
- export declare enum ErrorCode {
2
- BitmovinPlayerLicensingError = 1103,
3
- SetupMissingLicenseWhitelist = 1105,
4
- QualityChangeThresholdExceeded = 10000,
5
- BufferingTimeoutReached = 10001,
6
- VideoStartupTimeoutReached = 10002
1
+ export declare class ErrorCode {
2
+ readonly code: number;
3
+ readonly message: string;
4
+ static BITMOVIN_PLAYER_LICENSING_ERROR: ErrorCode;
5
+ static SETUP_MISSING_LICENSE_WHITELIST: ErrorCode;
6
+ static QUALITY_CHANGE_THRESHOLD_EXCEEDED: ErrorCode;
7
+ static BUFFERING_TIMEOUT_REACHED: ErrorCode;
8
+ static VIDEO_STARTUP_TIMEOUT_REACHED: ErrorCode;
9
+ private constructor();
7
10
  }
@@ -1,3 +1,4 @@
1
+ import { AnalyticsEventBase, AudioChangeEvent, ErrorEvent, SourceChangeEvent, VideoChangeEvent } from '../types/EventData';
1
2
  export declare enum Event {
2
3
  READY = "ready",
3
4
  SOURCE_LOADED = "sourceLoaded",
@@ -31,3 +32,36 @@ export declare enum Event {
31
32
  VIDEOSTART_TIMEOUT = "VIDEOSTART_TIMEOUT",
32
33
  CUSTOM_DATA_CHANGE = "customDataChange"
33
34
  }
35
+ export interface EventMap {
36
+ [Event.READY]: AnalyticsEventBase;
37
+ [Event.SOURCE_LOADED]: AnalyticsEventBase;
38
+ [Event.PLAY]: AnalyticsEventBase;
39
+ [Event.PLAYING]: AnalyticsEventBase;
40
+ [Event.PAUSE]: AnalyticsEventBase;
41
+ [Event.TIMECHANGED]: AnalyticsEventBase;
42
+ [Event.SEEK]: AnalyticsEventBase;
43
+ [Event.SEEKED]: AnalyticsEventBase;
44
+ [Event.START_CAST]: AnalyticsEventBase;
45
+ [Event.END_CAST]: AnalyticsEventBase;
46
+ [Event.START_BUFFERING]: AnalyticsEventBase;
47
+ [Event.END_BUFFERING]: AnalyticsEventBase;
48
+ [Event.AUDIOTRACK_CHANGED]: AnalyticsEventBase;
49
+ [Event.AUDIO_CHANGE]: AudioChangeEvent;
50
+ [Event.VIDEO_CHANGE]: VideoChangeEvent;
51
+ [Event.START_FULLSCREEN]: AnalyticsEventBase;
52
+ [Event.END_FULLSCREEN]: AnalyticsEventBase;
53
+ [Event.START_AD]: AnalyticsEventBase;
54
+ [Event.SUBTITLE_CHANGE]: AnalyticsEventBase;
55
+ [Event.END_AD]: AnalyticsEventBase;
56
+ [Event.MUTE]: AnalyticsEventBase;
57
+ [Event.UN_MUTE]: AnalyticsEventBase;
58
+ [Event.ERROR]: ErrorEvent;
59
+ [Event.PLAYBACK_FINISHED]: AnalyticsEventBase;
60
+ [Event.SCREEN_RESIZE]: AnalyticsEventBase;
61
+ [Event.UNLOAD]: AnalyticsEventBase;
62
+ [Event.END]: AnalyticsEventBase;
63
+ [Event.SOURCE_UNLOADED]: AnalyticsEventBase;
64
+ [Event.MANUAL_SOURCE_CHANGE]: SourceChangeEvent;
65
+ [Event.VIDEOSTART_TIMEOUT]: AnalyticsEventBase;
66
+ [Event.CUSTOM_DATA_CHANGE]: AnalyticsEventBase;
67
+ }