bitmovin-analytics 2.37.1 → 2.38.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/bitmovin-analytics.d.ts
CHANGED
|
@@ -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
|
-
|
|
15
|
-
|
|
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
|
-
|
|
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,6 +92,7 @@ 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;
|
|
@@ -107,7 +107,7 @@ export interface SsaiAdMetadata {
|
|
|
107
107
|
export interface SsaiAdBreakMetadata {
|
|
108
108
|
adPosition?: AdPosition;
|
|
109
109
|
}
|
|
110
|
-
export type AdPosition = "
|
|
110
|
+
export type AdPosition = "midroll" | "postroll" | "preroll";
|
|
111
111
|
export interface SsaiApi {
|
|
112
112
|
adBreakStart(adBreakMetadata?: SsaiAdBreakMetadata): any;
|
|
113
113
|
adStart(adMetadata?: SsaiAdMetadata): any;
|
|
@@ -203,8 +203,8 @@ export interface Sample extends CustomDataValues {
|
|
|
203
203
|
completedTotal?: number;
|
|
204
204
|
customUserId?: string;
|
|
205
205
|
deviceInformation?: {
|
|
206
|
-
model?: string;
|
|
207
206
|
deviceClass?: string;
|
|
207
|
+
model?: string;
|
|
208
208
|
};
|
|
209
209
|
domain?: any;
|
|
210
210
|
downloadSpeedInfo?: DownloadSpeedInfo;
|
|
@@ -270,7 +270,7 @@ declare class SsaiService {
|
|
|
270
270
|
* eventHandler is outside dependency.
|
|
271
271
|
* Due to the structure it is not possible to pass it to constructor of this class
|
|
272
272
|
*/
|
|
273
|
-
eventHandler:
|
|
273
|
+
eventHandler: SsaiEventHandler | undefined;
|
|
274
274
|
private state;
|
|
275
275
|
/**
|
|
276
276
|
* represents the current playing ad metdata
|
|
@@ -372,8 +372,8 @@ export interface FeatureConfigContainer {
|
|
|
372
372
|
errorDetails?: ErrorDetailTrackingConfig;
|
|
373
373
|
}
|
|
374
374
|
declare enum PlayerSize {
|
|
375
|
-
|
|
376
|
-
|
|
375
|
+
Fullscreen = "FULLSCREEN",
|
|
376
|
+
Window = "WINDOW"
|
|
377
377
|
}
|
|
378
378
|
export interface PlaybackInfo {
|
|
379
379
|
isLive?: boolean;
|
|
@@ -408,7 +408,7 @@ export interface SegmentInfo {
|
|
|
408
408
|
timestamp: number;
|
|
409
409
|
url: string;
|
|
410
410
|
}
|
|
411
|
-
export type HeartbeatPayload = Pick<Sample, "
|
|
411
|
+
export type HeartbeatPayload = Pick<Sample, "buffered"> | Pick<Sample, "paused"> | Pick<Sample, "played">;
|
|
412
412
|
export interface StateMachineCallbacks {
|
|
413
413
|
setup: (duration: number, state: string) => void;
|
|
414
414
|
startup: (duration: number, state: string) => void;
|
|
@@ -450,25 +450,6 @@ export interface StateMachineCallbacks {
|
|
|
450
450
|
release: () => void;
|
|
451
451
|
playlistTransition: (event: Readonly<AnalyticsEventBase>) => void;
|
|
452
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
453
|
declare class AdCallbacks {
|
|
473
454
|
onAdStarted: (event: any) => void;
|
|
474
455
|
onAdFinished: (event: any) => void;
|
|
@@ -493,6 +474,25 @@ export interface AdModuleAPI {
|
|
|
493
474
|
};
|
|
494
475
|
currentTime: () => number;
|
|
495
476
|
}
|
|
477
|
+
export interface Subscribable<TArgs> {
|
|
478
|
+
subscribe(callback: EventHandler<TArgs>): () => void;
|
|
479
|
+
unsubscribe(callback: EventHandler<TArgs>): any;
|
|
480
|
+
}
|
|
481
|
+
export type EventHandler<TArgs> = (args: TArgs) => void;
|
|
482
|
+
declare class EventDispatcher<TArgs> implements Subscribable<TArgs> {
|
|
483
|
+
private callbacks;
|
|
484
|
+
subscribe(callback: EventHandler<TArgs>): () => void;
|
|
485
|
+
dispatch(args: TArgs): void;
|
|
486
|
+
unsubscribe(callback: EventHandler<TArgs>): void;
|
|
487
|
+
get subscriberCount(): number;
|
|
488
|
+
}
|
|
489
|
+
export interface DeferredLicenseLoadingAdapterAPI {
|
|
490
|
+
readonly supportsDeferredLicenseLoading?: boolean;
|
|
491
|
+
readonly onLicenseKeyReceived: Subscribable<{
|
|
492
|
+
licenseKey: string;
|
|
493
|
+
}>;
|
|
494
|
+
readonly onLicenseCallFailed: Subscribable<any>;
|
|
495
|
+
}
|
|
496
496
|
export interface InternalAdapterAPI extends DeferredLicenseLoadingAdapterAPI {
|
|
497
497
|
readonly downloadSpeedInfo: DownloadSpeedInfo;
|
|
498
498
|
readonly segments: SegmentInfo[];
|
|
@@ -513,13 +513,6 @@ export interface InternalAdapterAPI extends DeferredLicenseLoadingAdapterAPI {
|
|
|
513
513
|
onError?(): void;
|
|
514
514
|
setCustomData(values: CustomDataValues): void;
|
|
515
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
516
|
export interface OnErrorDetailEventObject {
|
|
524
517
|
code: number | undefined;
|
|
525
518
|
message: string | undefined;
|
|
@@ -531,6 +524,13 @@ export interface ErrorDetailTrackingSettingsProvider {
|
|
|
531
524
|
readonly impressionId: string;
|
|
532
525
|
readonly collectorConfig?: CollectorConfig;
|
|
533
526
|
}
|
|
527
|
+
declare class FeatureManager<TConfigContainer> {
|
|
528
|
+
private features;
|
|
529
|
+
registerFeatures(features: Array<Feature<TConfigContainer, FeatureConfig>>): void;
|
|
530
|
+
unregisterFeatures(): void;
|
|
531
|
+
resetFeatures(): void;
|
|
532
|
+
configureFeatures(authenticated: boolean, featureConfigs?: TConfigContainer): void;
|
|
533
|
+
}
|
|
534
534
|
export interface Backend {
|
|
535
535
|
sendRequest(sample: Sample): any;
|
|
536
536
|
sendUnloadRequest(sample: Sample): any;
|
|
@@ -628,6 +628,8 @@ declare class Analytics {
|
|
|
628
628
|
declare abstract class Adapter {
|
|
629
629
|
protected analytics: Analytics;
|
|
630
630
|
protected internalAdapter: InternalAdapterAPI;
|
|
631
|
+
static version: string;
|
|
632
|
+
get version(): string;
|
|
631
633
|
getCurrentImpressionId(): string | undefined;
|
|
632
634
|
getUserId(): string | undefined;
|
|
633
635
|
setCustomData(values: CustomDataValues): void;
|
|
@@ -661,10 +663,10 @@ export declare class HlsAdapter extends Adapter implements AdapterAPI {
|
|
|
661
663
|
}
|
|
662
664
|
export declare class HTMLVideoElementAdapter extends Adapter implements AdapterAPI {
|
|
663
665
|
constructor(config: AnalyticsConfig, player: HTMLVideoElement, opts?: AnalyticsStateMachineOptions, sourceMetadata?: {
|
|
664
|
-
streamFormat?: string;
|
|
665
666
|
audioCodec?: string;
|
|
666
|
-
videoCodec?: string;
|
|
667
667
|
audioLanguage?: string;
|
|
668
|
+
streamFormat?: string;
|
|
669
|
+
videoCodec?: string;
|
|
668
670
|
});
|
|
669
671
|
get sessionMetadata(): {
|
|
670
672
|
readonly setAudioLanguage: (audioLanguage: string) => void;
|
|
@@ -672,10 +674,10 @@ export declare class HTMLVideoElementAdapter extends Adapter implements AdapterA
|
|
|
672
674
|
readonly setSubtitleLanguage: (subtitleLanguage: string) => void;
|
|
673
675
|
};
|
|
674
676
|
sourceChange(config: AnalyticsConfig, sourceMetadata?: {
|
|
675
|
-
streamFormat?: string;
|
|
676
677
|
audioCodec?: string;
|
|
677
|
-
videoCodec?: string;
|
|
678
678
|
audioLanguage?: string;
|
|
679
|
+
streamFormat?: string;
|
|
680
|
+
videoCodec?: string;
|
|
679
681
|
}): void;
|
|
680
682
|
}
|
|
681
683
|
export declare class ShakaAdapter extends Adapter implements AdapterAPI {
|
|
@@ -686,26 +688,26 @@ export declare class VideojsAdapter extends Adapter implements AdapterAPI {
|
|
|
686
688
|
constructor(config: AnalyticsConfig, player: any, opts?: AnalyticsStateMachineOptions);
|
|
687
689
|
}
|
|
688
690
|
declare enum CdnProvider {
|
|
689
|
-
CLOUDFLARE = "cloudflare",
|
|
690
691
|
AKAMAI = "akamai",
|
|
691
|
-
|
|
692
|
-
MAXCDN = "maxcdn",
|
|
693
|
-
CLOUDFRONT = "cloudfront",
|
|
692
|
+
BITGRAVITY = "bitgravity",
|
|
694
693
|
CHINACACHE = "chinacache",
|
|
695
|
-
|
|
694
|
+
CLOUDFLARE = "cloudflare",
|
|
695
|
+
CLOUDFRONT = "cloudfront",
|
|
696
|
+
FASTLY = "fastly",
|
|
697
|
+
MAXCDN = "maxcdn"
|
|
696
698
|
}
|
|
697
699
|
declare enum Player {
|
|
700
|
+
AMAZON_IVS = "amazonivs",
|
|
698
701
|
BITMOVIN = "bitmovin",
|
|
699
702
|
BITMOVIN_PWX = "bitmovin-pwx",
|
|
703
|
+
CHROMECAST_SHAKA = "chromecast-shaka",
|
|
704
|
+
DASHJS = "dashjs",
|
|
705
|
+
HLSJS = "hlsjs",
|
|
706
|
+
HTML5 = "html5",
|
|
700
707
|
JW = "jw",
|
|
701
708
|
RADIANT = "radiant",
|
|
702
|
-
VIDEOJS = "videojs",
|
|
703
|
-
HLSJS = "hlsjs",
|
|
704
709
|
SHAKA = "shaka",
|
|
705
|
-
|
|
706
|
-
HTML5 = "html5",
|
|
707
|
-
CHROMECAST_SHAKA = "chromecast-shaka",
|
|
708
|
-
AMAZON_IVS = "amazonivs"
|
|
710
|
+
VIDEOJS = "videojs"
|
|
709
711
|
}
|
|
710
712
|
/**
|
|
711
713
|
* @see https://github.com/bitmovin-engineering/bitdash/blob/ccd3227dac82d1416a471711b40ee0f65d7f9ddb/src/ModuleDefinition.ts#L17
|
|
@@ -719,6 +721,7 @@ export declare const PlayerModule: {
|
|
|
719
721
|
readonly setup: (module: any, player: any) => Promise<any>;
|
|
720
722
|
};
|
|
721
723
|
};
|
|
724
|
+
declare const VERSION: string;
|
|
722
725
|
export declare const adapters: {
|
|
723
726
|
AmazonIVSAdapter: typeof AmazonIVSAdapter;
|
|
724
727
|
Bitmovin8Adapter: typeof Bitmovin8Adapter;
|