@wscsports/blaze-web-sdk 0.20.0 → 0.21.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/package.json +19 -4
- package/publish/index.d.ts +297 -58
- package/publish/index.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wscsports/blaze-web-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"main": "publish/index",
|
|
5
5
|
"types": "publish/index",
|
|
6
6
|
"files": [
|
|
@@ -15,14 +15,27 @@
|
|
|
15
15
|
"publish:latest": "npm run build:prod && npm publish --access public --tag latest",
|
|
16
16
|
"publish:beta": "npm run build:prod && npm publish --access public --tag beta",
|
|
17
17
|
"version-download": "node ./version-downloader.js",
|
|
18
|
-
|
|
19
|
-
"test
|
|
18
|
+
|
|
19
|
+
"test": "node ./node_modules/@playwright/test/cli.js test --project='Desktop Chrome'",
|
|
20
|
+
"test:desktop": "node ./node_modules/@playwright/test/cli.js test --project='Desktop Chrome' --project='Desktop Firefox' --project='Desktop Safari'",
|
|
21
|
+
"test:desktop:stories": "node ./node_modules/@playwright/test/cli.js test --project='Desktop Chrome' --project='Desktop Safari' e2e-tests/tests/stories",
|
|
22
|
+
"test:desktop:moments": "node ./node_modules/@playwright/test/cli.js test --project='Desktop Chrome' --project='Desktop Safari' e2e-tests/tests/moments",
|
|
23
|
+
"test:desktop:long-form": "node ./node_modules/@playwright/test/cli.js test --project='Desktop Chrome' --project='Desktop Safari' e2e-tests/tests/video-longform",
|
|
24
|
+
|
|
25
|
+
"test:mobile": "node ./node_modules/@playwright/test/cli.js test --project='iOS Safari 13' --project='Android Chrome'",
|
|
26
|
+
"test:mobile:stories": "node ./node_modules/@playwright/test/cli.js test --project='iOS Safari 13' --project='Android Chrome' e2e-tests/tests/stories",
|
|
27
|
+
"test:mobile:moments": "node ./node_modules/@playwright/test/cli.js test --project='iOS Safari 13' e2e-tests/tests/moments",
|
|
28
|
+
"test:mobile:long-form": "node ./node_modules/@playwright/test/cli.js test --project='iOS Safari 13' e2e-tests/tests/video-longform",
|
|
29
|
+
|
|
30
|
+
"test:android:stories": "export USE_PHYSICAL_DEVICE=true && export $(cat .env.physical-device 2>/dev/null | xargs) && node ./node_modules/@playwright/test/cli.js test --config=playwright.config.physical-device.ts --project='Android Mobile Chrome' e2e-tests/tests/stories",
|
|
31
|
+
"test:android:moments": "export USE_PHYSICAL_DEVICE=true && export $(cat .env.physical-device 2>/dev/null | xargs) && node ./node_modules/@playwright/test/cli.js test --config=playwright.config.physical-device.ts --project='Android Mobile Chrome' e2e-tests/tests/moments"
|
|
20
32
|
},
|
|
21
33
|
"devDependencies": {
|
|
22
|
-
"@playwright/test": "^1.
|
|
34
|
+
"@playwright/test": "^1.56.0",
|
|
23
35
|
"@types/animejs": "^3.1.7",
|
|
24
36
|
"@types/google_interactive_media_ads_types": "^1.20241219.0",
|
|
25
37
|
"@types/hammerjs": "^2.0.45",
|
|
38
|
+
"@types/node": "^24.7.0",
|
|
26
39
|
"@types/ua-parser-js": "^0.7.36",
|
|
27
40
|
"@types/uuid": "^10.0.0",
|
|
28
41
|
"@types/videojs-vtt.js": "^0.15.3",
|
|
@@ -34,6 +47,8 @@
|
|
|
34
47
|
"javascript-obfuscator": "^4.0.2",
|
|
35
48
|
"media-captions": "^0.0.18",
|
|
36
49
|
"npm-registry-fetch": "^16.0.0",
|
|
50
|
+
"playwright-chromium": "^1.56.0",
|
|
51
|
+
"playwright-webkit": "^1.56.0",
|
|
37
52
|
"style-loader": "^3.3.3",
|
|
38
53
|
"ts-loader": "^9.4.4",
|
|
39
54
|
"typescript": "^5.4.2",
|
package/publish/index.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
type PlayContentOptions = {
|
|
2
|
-
dataSource: BlazeDataSourceType;
|
|
3
|
-
actionHandlers?: ActionHandler[];
|
|
4
|
-
style?: StoryPlayerStyle | VideoPlayerStyle | MomentPlayerStyle;
|
|
5
|
-
shouldOrderContentByReadStatus?: boolean;
|
|
6
|
-
};
|
|
7
1
|
export declare function setDoNotTrack(value: boolean): void;
|
|
8
2
|
export declare function setGeoLocation(value: string): void;
|
|
9
3
|
export declare function setExternalUserId(value: string): Promise<void>;
|
|
@@ -1271,6 +1265,8 @@ export declare const Z_INDEX: {
|
|
|
1271
1265
|
readonly player: "1";
|
|
1272
1266
|
readonly interaction: "2";
|
|
1273
1267
|
readonly onTopOfPlayer: "3";
|
|
1268
|
+
readonly menuBackdrop: "99";
|
|
1269
|
+
readonly menu: "100";
|
|
1274
1270
|
};
|
|
1275
1271
|
|
|
1276
1272
|
export declare const ONE_SECOND = 1000;
|
|
@@ -1590,6 +1586,7 @@ export interface IRendition {
|
|
|
1590
1586
|
aspectRatio: ContentAspectRatio;
|
|
1591
1587
|
bitRate: number;
|
|
1592
1588
|
fileSize: number;
|
|
1589
|
+
fileType?: 'Mp4' | 'Hls';
|
|
1593
1590
|
}
|
|
1594
1591
|
|
|
1595
1592
|
export interface IStory extends IContent {
|
|
@@ -2861,8 +2858,10 @@ declare abstract class VideoCacheServiceClass extends VideoCacheServiceClass_bas
|
|
|
2861
2858
|
private downloadControllers;
|
|
2862
2859
|
private cacheList;
|
|
2863
2860
|
private cacheInitialized;
|
|
2861
|
+
private cacheSupported;
|
|
2864
2862
|
private sizeLimit;
|
|
2865
2863
|
constructor();
|
|
2864
|
+
private isCacheSupported;
|
|
2866
2865
|
init(): Promise<void>;
|
|
2867
2866
|
private retryCacheInitialization;
|
|
2868
2867
|
checkCacheSize(): Promise<void>;
|
|
@@ -3870,6 +3869,7 @@ export * from './story-direction.type';
|
|
|
3870
3869
|
export * from './thumbnail.type';
|
|
3871
3870
|
export * from './trigger.type';
|
|
3872
3871
|
export * from './user.type';
|
|
3872
|
+
export * from './video-format.type';
|
|
3873
3873
|
export * from './widget.type';
|
|
3874
3874
|
export * from './chip-status.type';
|
|
3875
3875
|
export * from './prefetch.type';
|
|
@@ -3883,6 +3883,7 @@ export * from './action-handler.type';
|
|
|
3883
3883
|
export * from './cc-language.type';
|
|
3884
3884
|
export * from './widget-view-options.type';
|
|
3885
3885
|
export * from './content-item.type';
|
|
3886
|
+
export * from './play-content-options.type';
|
|
3886
3887
|
export * from './recommendations.type';
|
|
3887
3888
|
|
|
3888
3889
|
export type EntitiesType = 'playerId' | 'teamId' | 'gameId' | 'roundId';
|
|
@@ -3914,6 +3915,13 @@ export type BlazePersonalized = BlazePersonalizedIds | BlazePersonalizedLabels;
|
|
|
3914
3915
|
|
|
3915
3916
|
export type Platform = 'mobile' | 'tablet' | 'desktop';
|
|
3916
3917
|
|
|
3918
|
+
export type PlayContentOptions = {
|
|
3919
|
+
dataSource: BlazeDataSourceType;
|
|
3920
|
+
actionHandlers?: ActionHandler[];
|
|
3921
|
+
style?: StoryPlayerStyle | VideoPlayerStyle | MomentPlayerStyle;
|
|
3922
|
+
shouldOrderContentByReadStatus?: boolean;
|
|
3923
|
+
};
|
|
3924
|
+
|
|
3917
3925
|
export declare const PlayTypeArray: readonly ["Widget", "Share", "SingleContent", "AutoAdvance"];
|
|
3918
3926
|
export type PlayType = (typeof PlayTypeArray)[number];
|
|
3919
3927
|
|
|
@@ -3985,6 +3993,8 @@ export type TokenData = {
|
|
|
3985
3993
|
userId: string;
|
|
3986
3994
|
};
|
|
3987
3995
|
|
|
3996
|
+
export type VideoFormat = 'mp4' | 'hls' | '';
|
|
3997
|
+
|
|
3988
3998
|
export type IWidgetViewOptions = IWidgetViewOptionsWithLabels | IWidgetViewOptionsWithStoryIds | IWidgetViewOptionsWithDataSource | ICustomWidgetOptionsWithDataSource;
|
|
3989
3999
|
|
|
3990
4000
|
export type WidgetType = 'Row' | 'Grid';
|
|
@@ -4077,6 +4087,8 @@ export declare function findParentOfType<T>(target: EventTarget | null, type: {
|
|
|
4077
4087
|
}, stopAt: Element): T | null;
|
|
4078
4088
|
export declare function validateContainer(containerId: string, widgetElementName?: string): HTMLElement;
|
|
4079
4089
|
|
|
4090
|
+
export declare function fetchPosterWithHighPriority(posterUrl: string, timeout?: number): Promise<void>;
|
|
4091
|
+
|
|
4080
4092
|
export * from './accessibility-label.utils';
|
|
4081
4093
|
export * from './ad-info.utils';
|
|
4082
4094
|
export * from './cc-language.utils';
|
|
@@ -4086,6 +4098,7 @@ export * from './content-mapper.utils';
|
|
|
4086
4098
|
export * from './country-location.utils';
|
|
4087
4099
|
export * from './guard.utils';
|
|
4088
4100
|
export * from './helper';
|
|
4101
|
+
export * from './image.utils';
|
|
4089
4102
|
export * from './personalized.utils';
|
|
4090
4103
|
export * from './position.utils';
|
|
4091
4104
|
export * from './regex.utils';
|
|
@@ -4215,7 +4228,11 @@ export * from './core/video';
|
|
|
4215
4228
|
export * from './core/video-modal';
|
|
4216
4229
|
export * from './core/video-player';
|
|
4217
4230
|
export * from './factory/playback-strategy.factory';
|
|
4218
|
-
export * from './strategy/
|
|
4231
|
+
export * from './strategy/base-playback.strategy';
|
|
4232
|
+
export * from './strategy/long-form-hls.strategy';
|
|
4233
|
+
export * from './strategy/base-hls.strategy';
|
|
4234
|
+
export * from './strategy/short-form-hls.strategy';
|
|
4235
|
+
export * from './strategy/native-video.strategy';
|
|
4219
4236
|
export * from './interface/playback-strategy.interface';
|
|
4220
4237
|
export * from './video-events';
|
|
4221
4238
|
|
|
@@ -4779,9 +4796,19 @@ export declare class BlazeVideoElement extends BlazeWidgetVideoBase {
|
|
|
4779
4796
|
}
|
|
4780
4797
|
|
|
4781
4798
|
export declare class PlaybackStrategyFactory {
|
|
4782
|
-
static createStrategy(video: HTMLVideoElement, strategyType: string): PlaybackStrategy;
|
|
4799
|
+
static createStrategy(video: HTMLVideoElement, strategyType: string, widget?: BlazeWidgetVideo): PlaybackStrategy;
|
|
4800
|
+
}
|
|
4801
|
+
|
|
4802
|
+
export interface LoaderDelegate {
|
|
4803
|
+
show(): void;
|
|
4804
|
+
hide(): void;
|
|
4805
|
+
isVisible?(): boolean;
|
|
4783
4806
|
}
|
|
4784
4807
|
|
|
4808
|
+
export interface PlaybackStrategyOptions {
|
|
4809
|
+
overlay?: BlazeLongFormControlsOverlay;
|
|
4810
|
+
loaderDelegate?: LoaderDelegate;
|
|
4811
|
+
}
|
|
4785
4812
|
export interface PlayResult {
|
|
4786
4813
|
status: PlayStatus;
|
|
4787
4814
|
error?: unknown;
|
|
@@ -4793,7 +4820,11 @@ export declare enum PlayStatus {
|
|
|
4793
4820
|
export interface PlaybackStrategy {
|
|
4794
4821
|
play(): Promise<PlayResult>;
|
|
4795
4822
|
pause(): void;
|
|
4796
|
-
|
|
4823
|
+
isPaused(): boolean;
|
|
4824
|
+
isEnded(): boolean;
|
|
4825
|
+
getCurrentTime(): number;
|
|
4826
|
+
reset(): void;
|
|
4827
|
+
initialize(options?: PlaybackStrategyOptions): void;
|
|
4797
4828
|
toggleMute(): void;
|
|
4798
4829
|
setMuted(muted: boolean): void;
|
|
4799
4830
|
isMuted(): boolean;
|
|
@@ -4803,39 +4834,95 @@ export interface PlaybackStrategy {
|
|
|
4803
4834
|
loadSource(src: string, bitRate: number, startingTime: number): Promise<void>;
|
|
4804
4835
|
unload(): void;
|
|
4805
4836
|
destroy(): void;
|
|
4837
|
+
reloadWithNewSource?(src: string, bitRate?: number, startingTime?: number): Promise<void>;
|
|
4838
|
+
setContentMetadata?(metadata: {
|
|
4839
|
+
contentId?: string;
|
|
4840
|
+
contentTitle?: string;
|
|
4841
|
+
contentType?: string;
|
|
4842
|
+
sessionId?: string;
|
|
4843
|
+
}): void;
|
|
4806
4844
|
}
|
|
4807
4845
|
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4846
|
+
declare const Hls: any;
|
|
4847
|
+
export interface HLSConfig {
|
|
4848
|
+
maxBufferLength: number;
|
|
4849
|
+
maxMaxBufferLength: number;
|
|
4850
|
+
maxBufferSize: number;
|
|
4851
|
+
maxBufferHole: number;
|
|
4852
|
+
fragLoadingMaxRetry: number;
|
|
4853
|
+
fragLoadingRetryDelay: number;
|
|
4854
|
+
abrEwmaFastLive: number;
|
|
4855
|
+
abrEwmaSlowLive: number;
|
|
4856
|
+
abrEwmaFastVoD: number;
|
|
4857
|
+
abrEwmaSlowVoD: number;
|
|
4858
|
+
abrBandWidthFactor: number;
|
|
4859
|
+
abrBandWidthUpFactor: number;
|
|
4860
|
+
}
|
|
4861
|
+
export declare const HLS_CONFIGS: {
|
|
4862
|
+
readonly LONG_FORM: {
|
|
4863
|
+
readonly maxBufferLength: 30;
|
|
4864
|
+
readonly maxMaxBufferLength: 30;
|
|
4865
|
+
readonly maxBufferSize: number;
|
|
4866
|
+
readonly maxBufferHole: 4;
|
|
4867
|
+
readonly fragLoadingMaxRetry: 5;
|
|
4868
|
+
readonly fragLoadingRetryDelay: 1000;
|
|
4869
|
+
readonly abrEwmaFastLive: 3;
|
|
4870
|
+
readonly abrEwmaSlowLive: 9;
|
|
4871
|
+
readonly abrEwmaFastVoD: 3;
|
|
4872
|
+
readonly abrEwmaSlowVoD: 9;
|
|
4873
|
+
readonly abrBandWidthFactor: 0.95;
|
|
4874
|
+
readonly abrBandWidthUpFactor: 0.7;
|
|
4875
|
+
};
|
|
4876
|
+
readonly SHORT_FORM: {
|
|
4877
|
+
readonly maxBufferLength: 3;
|
|
4878
|
+
readonly maxMaxBufferLength: 5;
|
|
4879
|
+
readonly maxBufferSize: number;
|
|
4880
|
+
readonly maxBufferHole: 0.5;
|
|
4881
|
+
readonly fragLoadingMaxRetry: 2;
|
|
4882
|
+
readonly fragLoadingRetryDelay: 200;
|
|
4883
|
+
readonly abrEwmaFastLive: 1;
|
|
4884
|
+
readonly abrEwmaSlowLive: 2;
|
|
4885
|
+
readonly abrEwmaFastVoD: 1;
|
|
4886
|
+
readonly abrEwmaSlowVoD: 2;
|
|
4887
|
+
readonly abrBandWidthFactor: 0.9;
|
|
4888
|
+
readonly abrBandWidthUpFactor: 0.8;
|
|
4889
|
+
};
|
|
4890
|
+
};
|
|
4891
|
+
export declare abstract class BaseHLSStrategy extends BasePlaybackStrategy {
|
|
4892
|
+
protected hls?: typeof Hls;
|
|
4893
|
+
protected initialBitrateBps: number;
|
|
4894
|
+
protected retryCount: number;
|
|
4895
|
+
protected maxRetries: number;
|
|
4896
|
+
protected lastTime: number;
|
|
4897
|
+
protected playbackWatchdogTimeout?: ReturnType<typeof setTimeout>;
|
|
4898
|
+
protected loaderTimeout?: ReturnType<typeof setTimeout>;
|
|
4899
|
+
protected recoveryTimeout?: ReturnType<typeof setTimeout>;
|
|
4900
|
+
protected seekRecoveryListener?: () => void;
|
|
4901
|
+
protected boundOnManifestParsed: () => void;
|
|
4902
|
+
protected boundOnBufferAppended: () => void;
|
|
4903
|
+
protected boundOnFragParsed: () => void;
|
|
4904
|
+
protected boundOnLoadedMetadata: () => void;
|
|
4905
|
+
protected boundOnPlaying: () => void;
|
|
4906
|
+
protected boundOnCanPlay: () => void;
|
|
4907
|
+
protected boundOnError: (event: any, data: any) => void;
|
|
4908
|
+
protected boundOnNativeError: (e: Event) => void;
|
|
4829
4909
|
constructor(video: HTMLVideoElement);
|
|
4830
|
-
initialize(
|
|
4910
|
+
abstract initialize(options?: any): void;
|
|
4911
|
+
protected abstract onLoadingState(): void;
|
|
4912
|
+
protected abstract onBufferUpdate(progress: number): void;
|
|
4913
|
+
protected abstract onError(event: any, data: any): void;
|
|
4914
|
+
protected setupEventListeners(): void;
|
|
4831
4915
|
loadSource(src: string, initialBitrate: number, startingTime?: number): Promise<void>;
|
|
4916
|
+
protected setupHLSInstance(src: string, startingTime: number, config?: HLSConfig): void;
|
|
4917
|
+
protected setupNativeHLS(src: string, startingTime: number): void;
|
|
4832
4918
|
unload(): void;
|
|
4833
4919
|
destroy(): void;
|
|
4834
|
-
private waitForVideoCondition;
|
|
4835
4920
|
play(): Promise<PlayResult>;
|
|
4836
|
-
private startPlaybackWatchdog;
|
|
4837
|
-
private handlePlaybackTimeout;
|
|
4838
4921
|
pause(): void;
|
|
4922
|
+
isPaused(): boolean;
|
|
4923
|
+
isEnded(): boolean;
|
|
4924
|
+
getCurrentTime(): number;
|
|
4925
|
+
reset(): void;
|
|
4839
4926
|
getDuration(): number;
|
|
4840
4927
|
isMuted(): boolean;
|
|
4841
4928
|
seek(clampedSeek: number): void;
|
|
@@ -4844,23 +4931,162 @@ export declare class HLSStrategy implements PlaybackStrategy {
|
|
|
4844
4931
|
mute(): void;
|
|
4845
4932
|
unmute(): void;
|
|
4846
4933
|
toggleFullscreen(): void;
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4934
|
+
protected waitForVideoCondition<T extends keyof HTMLMediaElementEventMap>(predicate: () => boolean, eventType: T, timeoutMs?: number): Promise<HTMLMediaElementEventMap[T] | void>;
|
|
4935
|
+
protected startPlaybackWatchdog(): void;
|
|
4936
|
+
protected handlePlaybackTimeout(): void;
|
|
4937
|
+
protected handleSeekRecovery(seekTime: number): void;
|
|
4938
|
+
protected isSlowConnection(): boolean;
|
|
4939
|
+
protected handleManifestParsed(): void;
|
|
4940
|
+
protected handleBufferAppended(): void;
|
|
4941
|
+
protected handleFragParsed(): void;
|
|
4942
|
+
protected handleError(event: any, data: any): void;
|
|
4943
|
+
protected handlePlaying(): void;
|
|
4944
|
+
protected handleNativeError(e: Event): void;
|
|
4945
|
+
protected handleLoadedMetadata(): void;
|
|
4946
|
+
protected getBufferProgress(): number;
|
|
4947
|
+
protected showLoader(): void;
|
|
4948
|
+
protected hideLoader(): void;
|
|
4949
|
+
protected nudgePlayback(): void;
|
|
4950
|
+
protected handleNetworkError(): void;
|
|
4951
|
+
protected handleOnlineNetworkRecovery: () => void;
|
|
4952
|
+
protected handleMediaError(): void;
|
|
4953
|
+
protected recoverNativeHls(): void;
|
|
4954
|
+
protected reloadStream(): void;
|
|
4955
|
+
reloadWithNewSource(newSrc: string, initialBitrate?: number, startingTime?: number): Promise<void>;
|
|
4956
|
+
}
|
|
4957
|
+
|
|
4958
|
+
export declare abstract class BasePlaybackStrategy implements PlaybackStrategy {
|
|
4959
|
+
protected video: HTMLVideoElement;
|
|
4960
|
+
protected contentId?: string;
|
|
4961
|
+
protected contentTitle?: string;
|
|
4962
|
+
protected contentType?: string;
|
|
4963
|
+
protected sessionId?: string;
|
|
4964
|
+
protected playAttemptStartTime: number;
|
|
4965
|
+
abstract play(): Promise<PlayResult>;
|
|
4966
|
+
abstract pause(): void;
|
|
4967
|
+
abstract isPaused(): boolean;
|
|
4968
|
+
abstract isEnded(): boolean;
|
|
4969
|
+
abstract getCurrentTime(): number;
|
|
4970
|
+
abstract reset(): void;
|
|
4971
|
+
abstract initialize(options?: any): void;
|
|
4972
|
+
abstract toggleMute(): void;
|
|
4973
|
+
abstract setMuted(muted: boolean): void;
|
|
4974
|
+
abstract isMuted(): boolean;
|
|
4975
|
+
abstract toggleFullscreen(): void;
|
|
4976
|
+
abstract seek(time: number): void;
|
|
4977
|
+
abstract getDuration(): number;
|
|
4978
|
+
abstract loadSource(src: string, bitRate: number, startingTime: number): Promise<void>;
|
|
4979
|
+
abstract unload(): void;
|
|
4980
|
+
abstract destroy(): void;
|
|
4981
|
+
setContentMetadata(metadata: {
|
|
4982
|
+
contentId?: string;
|
|
4983
|
+
contentTitle?: string;
|
|
4984
|
+
contentType?: string;
|
|
4985
|
+
sessionId?: string;
|
|
4986
|
+
}): void;
|
|
4987
|
+
protected dispatchPlaybackEvent(eventStatus: 'success' | 'failed' | 'ready' | 'changed' | 'buffering' | 'recovered', context: {
|
|
4988
|
+
result?: PlayResult;
|
|
4989
|
+
timeToPlay?: number;
|
|
4990
|
+
timeToFail?: number;
|
|
4991
|
+
error?: any;
|
|
4992
|
+
previousState?: any;
|
|
4993
|
+
newState?: any;
|
|
4994
|
+
}): void;
|
|
4995
|
+
}
|
|
4996
|
+
|
|
4997
|
+
export declare class LongFormHlsStrategy extends BaseHLSStrategy {
|
|
4998
|
+
private videoOverlay?;
|
|
4999
|
+
initialize(options?: PlaybackStrategyOptions): void;
|
|
5000
|
+
private configureVideoElement;
|
|
5001
|
+
protected onLoadingState(): void;
|
|
5002
|
+
protected onBufferUpdate(progress: number): void;
|
|
5003
|
+
protected onError(event: any, data: any): void;
|
|
5004
|
+
toggleFullscreen(): void;
|
|
5005
|
+
}
|
|
5006
|
+
|
|
5007
|
+
export declare class NativeVideoStrategy extends BasePlaybackStrategy {
|
|
5008
|
+
protected video: HTMLVideoElement;
|
|
5009
|
+
private videoComponent;
|
|
5010
|
+
private lastErrorExecutionTime;
|
|
5011
|
+
private loaderDelegate?;
|
|
5012
|
+
private playbackTimeout?;
|
|
5013
|
+
private readonly PLAYBACK_TIMEOUT_MS;
|
|
5014
|
+
private boundOnError;
|
|
5015
|
+
private boundOnPlaying;
|
|
5016
|
+
private boundOnPause;
|
|
5017
|
+
private boundOnCanPlayThrough;
|
|
5018
|
+
private progressCheckInterval?;
|
|
5019
|
+
private lastProgressTime;
|
|
5020
|
+
private lastCurrentTime;
|
|
5021
|
+
private boundOnTimeUpdate;
|
|
5022
|
+
constructor(video: HTMLVideoElement, videoComponent: BlazeWidgetVideo);
|
|
5023
|
+
private setupErrorHandling;
|
|
4861
5024
|
private handlePlaying;
|
|
4862
|
-
private
|
|
4863
|
-
private
|
|
5025
|
+
private handlePause;
|
|
5026
|
+
private handleTimeUpdate;
|
|
5027
|
+
private handleCanPlayThrough;
|
|
5028
|
+
private startPlaybackTimeout;
|
|
5029
|
+
private clearPlaybackTimeout;
|
|
5030
|
+
private handlePlaybackTimeout;
|
|
5031
|
+
private handleNativeVideoError;
|
|
5032
|
+
play(): Promise<PlayResult>;
|
|
5033
|
+
private playWithRetry;
|
|
5034
|
+
private reloadAndRetry;
|
|
5035
|
+
pause(): void;
|
|
5036
|
+
getCurrentTime(): number;
|
|
5037
|
+
getDuration(): number;
|
|
5038
|
+
isPaused(): boolean;
|
|
5039
|
+
isEnded(): boolean;
|
|
5040
|
+
isMuted(): boolean;
|
|
5041
|
+
setMuted(muted: boolean): void;
|
|
5042
|
+
mute(): void;
|
|
5043
|
+
unmute(): void;
|
|
5044
|
+
seek(seekPercentage: number): void;
|
|
5045
|
+
toggleMute(): void;
|
|
5046
|
+
toggleFullscreen(): void;
|
|
5047
|
+
loadSource(src: string): Promise<void>;
|
|
5048
|
+
initialize(options?: PlaybackStrategyOptions): void;
|
|
5049
|
+
private configureVideoElement;
|
|
5050
|
+
unload(): void;
|
|
5051
|
+
destroy(): void;
|
|
5052
|
+
reset(): void;
|
|
5053
|
+
private startProgressBasedLoaderCleanup;
|
|
5054
|
+
private stopProgressBasedLoaderCleanup;
|
|
5055
|
+
private checkVideoProgressAndCleanupLoader;
|
|
5056
|
+
}
|
|
5057
|
+
|
|
5058
|
+
export declare class ShortFormHLSStrategy extends BaseHLSStrategy {
|
|
5059
|
+
private loaderDelegate?;
|
|
5060
|
+
private isPrefetchMode;
|
|
5061
|
+
private fragmentsLoaded;
|
|
5062
|
+
private readonly maxPrefetchFragments;
|
|
5063
|
+
private isBufferLoaderActive;
|
|
5064
|
+
private progressCheckInterval?;
|
|
5065
|
+
private lastProgressTime;
|
|
5066
|
+
private lastCurrentTime;
|
|
5067
|
+
private boundOnTimeUpdate;
|
|
5068
|
+
initialize(options?: PlaybackStrategyOptions): void;
|
|
5069
|
+
protected setupEventListeners(): void;
|
|
5070
|
+
protected setupHLSInstance(src: string, startingTime: number): void;
|
|
5071
|
+
private handleManifestParsedForPrefetch;
|
|
5072
|
+
private startPrefetchLoading;
|
|
5073
|
+
enablePrefetchMode(): void;
|
|
5074
|
+
disablePrefetchMode(): void;
|
|
5075
|
+
protected onLoadingState(): void;
|
|
5076
|
+
protected onBufferUpdate(progress: number): void;
|
|
5077
|
+
protected handlePlaying(): void;
|
|
5078
|
+
protected handlePause(): void;
|
|
5079
|
+
protected onError(event: any, data: any): void;
|
|
5080
|
+
protected handleError(event: any, data: any): void;
|
|
5081
|
+
protected handleSeekRecovery(seekTime: number): void;
|
|
5082
|
+
seek(clampedSeek: number): void;
|
|
5083
|
+
play(): Promise<any>;
|
|
5084
|
+
pause(): void;
|
|
5085
|
+
unload(): void;
|
|
5086
|
+
private handleTimeUpdate;
|
|
5087
|
+
private startProgressBasedLoaderCleanup;
|
|
5088
|
+
private stopProgressBasedLoaderCleanup;
|
|
5089
|
+
private checkVideoProgressAndCleanupLoader;
|
|
4864
5090
|
}
|
|
4865
5091
|
|
|
4866
5092
|
export * from './widget-video-base';
|
|
@@ -4912,7 +5138,7 @@ export declare abstract class WidgetBaseLayout extends BlazeWidgetScrollable imp
|
|
|
4912
5138
|
abstract render(): void;
|
|
4913
5139
|
widgetType(): WidgetType;
|
|
4914
5140
|
get thumbnailShape(): ThumbnailShape;
|
|
4915
|
-
protected get theme(): IWidgetTheme<
|
|
5141
|
+
protected get theme(): IWidgetTheme<MomentPlayerStyle | StoryPlayerStyle | VideoPlayerStyle>;
|
|
4916
5142
|
protected updateActiveLayoutThemesPerItemWithEntity(key: EntitiesType, value: string, theme: IWidgetTheme): void;
|
|
4917
5143
|
protected setReloadData(options?: ISetWidgetOptions): void;
|
|
4918
5144
|
set contentIds(value: string);
|
|
@@ -5415,7 +5641,6 @@ export declare class BlazeWidgetModal extends BaseWidget {
|
|
|
5415
5641
|
constructor(type: ContentType);
|
|
5416
5642
|
connectedCallback(): void;
|
|
5417
5643
|
disconnectedCallback(): void;
|
|
5418
|
-
private isRealResizeEvent;
|
|
5419
5644
|
onResize(): void;
|
|
5420
5645
|
handleOnContentChange(mode: ContentDirection): void;
|
|
5421
5646
|
handleOnExitButtonClick(): void;
|
|
@@ -5615,7 +5840,6 @@ export declare class BlazeWidgetVideoBase extends HTMLElement {
|
|
|
5615
5840
|
disconnectedCallback(): void;
|
|
5616
5841
|
render(): void;
|
|
5617
5842
|
startEnter(): void;
|
|
5618
|
-
startExit(): void;
|
|
5619
5843
|
endEnter(): void;
|
|
5620
5844
|
endExit(): void;
|
|
5621
5845
|
}
|
|
@@ -5634,10 +5858,14 @@ export declare class BlazeWidgetVideo extends BlazeWidgetVideoBase {
|
|
|
5634
5858
|
loaderTimeoutRefAppending: NodeJS.Timeout | undefined;
|
|
5635
5859
|
lastErrorExecutionTime: number;
|
|
5636
5860
|
private beforeContentPlayService;
|
|
5861
|
+
private playbackStrategy?;
|
|
5862
|
+
private playerCommands?;
|
|
5863
|
+
private videoFormat;
|
|
5637
5864
|
isVideoStartPlaying: boolean;
|
|
5638
5865
|
isError: boolean;
|
|
5639
5866
|
isLoaded: boolean;
|
|
5640
5867
|
isVideoRunning: boolean;
|
|
5868
|
+
private isUnloading;
|
|
5641
5869
|
maxRetryTimes: number;
|
|
5642
5870
|
shouldShowImaAd: boolean;
|
|
5643
5871
|
isCurrentlyTryingToRunImaAd: boolean;
|
|
@@ -5658,15 +5886,19 @@ export declare class BlazeWidgetVideo extends BlazeWidgetVideoBase {
|
|
|
5658
5886
|
private isEnableInteractions;
|
|
5659
5887
|
loadClosedCaptions(): Promise<void>;
|
|
5660
5888
|
getVideoDuration(existingVideo?: HTMLVideoElement): Promise<number>;
|
|
5889
|
+
private determinePosterUrl;
|
|
5661
5890
|
loadPoster(): void;
|
|
5662
5891
|
display(): void;
|
|
5663
5892
|
hide(): void;
|
|
5664
5893
|
load(loadingType?: LoadingType): Promise<void>;
|
|
5665
5894
|
private setVideoSource;
|
|
5895
|
+
reloadHLSWithNewUrl(newVideoUrl: string): Promise<void>;
|
|
5896
|
+
private initializeHLSStrategy;
|
|
5897
|
+
private fallbackToNativeVideo;
|
|
5898
|
+
private cleanupHLSStrategy;
|
|
5666
5899
|
unload(): Promise<void>;
|
|
5667
5900
|
resetVideoState(): void;
|
|
5668
5901
|
removeLoader(): void;
|
|
5669
|
-
startPlayVideo(video: HTMLVideoElement, maxRetryTimes: number): Promise<void>;
|
|
5670
5902
|
tryReloadVideo(retryTime: number): void;
|
|
5671
5903
|
tryToAddLoader(): void;
|
|
5672
5904
|
play(): Promise<void>;
|
|
@@ -5678,18 +5910,18 @@ export declare class BlazeWidgetVideo extends BlazeWidgetVideoBase {
|
|
|
5678
5910
|
requestFrameCallback(callback: () => void): void;
|
|
5679
5911
|
mainElement(): CanvasImageSource;
|
|
5680
5912
|
get paused(): boolean;
|
|
5913
|
+
get ended(): boolean;
|
|
5681
5914
|
get muted(): boolean;
|
|
5682
5915
|
set muted(value: boolean);
|
|
5683
5916
|
get isAd(): boolean;
|
|
5684
5917
|
render(): void;
|
|
5685
|
-
restartVideo(): void;
|
|
5686
5918
|
handleAdStarted(): void;
|
|
5687
5919
|
handleAdEnded(): void;
|
|
5688
5920
|
loadInteraction(): void;
|
|
5689
5921
|
onLanguageChange(event: Event): Promise<void>;
|
|
5690
5922
|
handleInteractionEvent(event: CustomEvent<InteractionAnalyticCustomEvent>): void;
|
|
5691
5923
|
private tryToPlayAd;
|
|
5692
|
-
private
|
|
5924
|
+
private isBeingUnloaded;
|
|
5693
5925
|
}
|
|
5694
5926
|
|
|
5695
5927
|
export declare class BlazeWidgetAd extends BlazeWidgetVideoBase {
|
|
@@ -5822,7 +6054,7 @@ export declare class BlazeWidgetMomentModal extends BlazeWidgetModal {
|
|
|
5822
6054
|
setModalContent(data: IMoment[], indexOfContentInWidget: number, defaultAdsInfo?: IAdInfo): void;
|
|
5823
6055
|
onKeyDown(ev: KeyboardEvent): void;
|
|
5824
6056
|
close(): void;
|
|
5825
|
-
open(): void
|
|
6057
|
+
open(): Promise<void>;
|
|
5826
6058
|
play(): void;
|
|
5827
6059
|
setExitButtonDisplay(): void;
|
|
5828
6060
|
render(): void;
|
|
@@ -5910,6 +6142,8 @@ export declare class BlazeWidgetMomentSeekBar extends HTMLElement {
|
|
|
5910
6142
|
private progressBarFill;
|
|
5911
6143
|
private progressBarKnob;
|
|
5912
6144
|
private isMouseIn;
|
|
6145
|
+
private seekingTimeout?;
|
|
6146
|
+
private readonly SEEKING_DEBOUNCE_MS;
|
|
5913
6147
|
constructor(video: BlazeWidgetVideo | BlazeWidgetAd, seekBarStyle: BlazeMomentsPlayerSeekBarStyle);
|
|
5914
6148
|
static get observedAttributes(): string[];
|
|
5915
6149
|
attributeChangedCallback(name: string, oldValue: string, _newValue: string): void;
|
|
@@ -5938,6 +6172,9 @@ export declare class BlazeWidgetMomentSeekBar extends HTMLElement {
|
|
|
5938
6172
|
private createPlaybackPart;
|
|
5939
6173
|
private updateProgressBarStyles;
|
|
5940
6174
|
render(): void;
|
|
6175
|
+
private setupVideoEventListeners;
|
|
6176
|
+
private startSeekingLoader;
|
|
6177
|
+
private stopSeekingLoader;
|
|
5941
6178
|
}
|
|
5942
6179
|
|
|
5943
6180
|
interface ButtonElementOptions {
|
|
@@ -6181,6 +6418,7 @@ export declare class BlazeWidgetStory extends BlazeWidgetContent {
|
|
|
6181
6418
|
isStoryLoadCompletedTriggered: boolean;
|
|
6182
6419
|
isStoryActive: boolean;
|
|
6183
6420
|
isResumeOnFocusExecuted: boolean;
|
|
6421
|
+
isUnloading: boolean;
|
|
6184
6422
|
refWidget: BlazeWidgetStory[] | undefined;
|
|
6185
6423
|
ctaModal: BlazeWidgetCtaModal;
|
|
6186
6424
|
isCtaWasClickedOrSwiped: boolean;
|
|
@@ -6219,6 +6457,7 @@ export declare class BlazeWidgetStory extends BlazeWidgetContent {
|
|
|
6219
6457
|
totalPlayStopwatch: Stopwatch;
|
|
6220
6458
|
shadowTopElement: HTMLDivElement;
|
|
6221
6459
|
navigationTimeout: NodeJS.Timeout | null;
|
|
6460
|
+
prefetchTimeout: NodeJS.Timeout | null;
|
|
6222
6461
|
lastPageIndexToResume: number;
|
|
6223
6462
|
elementsToHideOnWebAds: (HTMLElement | undefined)[];
|
|
6224
6463
|
elementsToHideOnImaAds: (HTMLElement | undefined)[];
|
|
@@ -6280,7 +6519,7 @@ export declare class BlazeWidgetStory extends BlazeWidgetContent {
|
|
|
6280
6519
|
playPage(pageIndexToPlayNext: number): void;
|
|
6281
6520
|
updatePublishedDate(index?: number): void;
|
|
6282
6521
|
switchToPage(newPageIndex: number): void;
|
|
6283
|
-
startPage(indexToPlay: number): void
|
|
6522
|
+
startPage(indexToPlay: number): Promise<void>;
|
|
6284
6523
|
private shouldGetNewBannerAd;
|
|
6285
6524
|
unload(): void;
|
|
6286
6525
|
displayCurrentStoryPageAndHideTheRest(): void;
|