@wscsports/blaze-web-sdk 0.20.1 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wscsports/blaze-web-sdk",
3
- "version": "0.20.1",
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
- "test": "npx playwright test",
19
- "test:debug": "npx playwright test --debug"
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.44.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",
@@ -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>;
@@ -1592,6 +1586,7 @@ export interface IRendition {
1592
1586
  aspectRatio: ContentAspectRatio;
1593
1587
  bitRate: number;
1594
1588
  fileSize: number;
1589
+ fileType?: 'Mp4' | 'Hls';
1595
1590
  }
1596
1591
 
1597
1592
  export interface IStory extends IContent {
@@ -2863,8 +2858,10 @@ declare abstract class VideoCacheServiceClass extends VideoCacheServiceClass_bas
2863
2858
  private downloadControllers;
2864
2859
  private cacheList;
2865
2860
  private cacheInitialized;
2861
+ private cacheSupported;
2866
2862
  private sizeLimit;
2867
2863
  constructor();
2864
+ private isCacheSupported;
2868
2865
  init(): Promise<void>;
2869
2866
  private retryCacheInitialization;
2870
2867
  checkCacheSize(): Promise<void>;
@@ -3872,6 +3869,7 @@ export * from './story-direction.type';
3872
3869
  export * from './thumbnail.type';
3873
3870
  export * from './trigger.type';
3874
3871
  export * from './user.type';
3872
+ export * from './video-format.type';
3875
3873
  export * from './widget.type';
3876
3874
  export * from './chip-status.type';
3877
3875
  export * from './prefetch.type';
@@ -3885,6 +3883,7 @@ export * from './action-handler.type';
3885
3883
  export * from './cc-language.type';
3886
3884
  export * from './widget-view-options.type';
3887
3885
  export * from './content-item.type';
3886
+ export * from './play-content-options.type';
3888
3887
  export * from './recommendations.type';
3889
3888
 
3890
3889
  export type EntitiesType = 'playerId' | 'teamId' | 'gameId' | 'roundId';
@@ -3916,6 +3915,13 @@ export type BlazePersonalized = BlazePersonalizedIds | BlazePersonalizedLabels;
3916
3915
 
3917
3916
  export type Platform = 'mobile' | 'tablet' | 'desktop';
3918
3917
 
3918
+ export type PlayContentOptions = {
3919
+ dataSource: BlazeDataSourceType;
3920
+ actionHandlers?: ActionHandler[];
3921
+ style?: StoryPlayerStyle | VideoPlayerStyle | MomentPlayerStyle;
3922
+ shouldOrderContentByReadStatus?: boolean;
3923
+ };
3924
+
3919
3925
  export declare const PlayTypeArray: readonly ["Widget", "Share", "SingleContent", "AutoAdvance"];
3920
3926
  export type PlayType = (typeof PlayTypeArray)[number];
3921
3927
 
@@ -3987,6 +3993,8 @@ export type TokenData = {
3987
3993
  userId: string;
3988
3994
  };
3989
3995
 
3996
+ export type VideoFormat = 'mp4' | 'hls' | '';
3997
+
3990
3998
  export type IWidgetViewOptions = IWidgetViewOptionsWithLabels | IWidgetViewOptionsWithStoryIds | IWidgetViewOptionsWithDataSource | ICustomWidgetOptionsWithDataSource;
3991
3999
 
3992
4000
  export type WidgetType = 'Row' | 'Grid';
@@ -4079,6 +4087,8 @@ export declare function findParentOfType<T>(target: EventTarget | null, type: {
4079
4087
  }, stopAt: Element): T | null;
4080
4088
  export declare function validateContainer(containerId: string, widgetElementName?: string): HTMLElement;
4081
4089
 
4090
+ export declare function fetchPosterWithHighPriority(posterUrl: string, timeout?: number): Promise<void>;
4091
+
4082
4092
  export * from './accessibility-label.utils';
4083
4093
  export * from './ad-info.utils';
4084
4094
  export * from './cc-language.utils';
@@ -4088,6 +4098,7 @@ export * from './content-mapper.utils';
4088
4098
  export * from './country-location.utils';
4089
4099
  export * from './guard.utils';
4090
4100
  export * from './helper';
4101
+ export * from './image.utils';
4091
4102
  export * from './personalized.utils';
4092
4103
  export * from './position.utils';
4093
4104
  export * from './regex.utils';
@@ -4217,7 +4228,11 @@ export * from './core/video';
4217
4228
  export * from './core/video-modal';
4218
4229
  export * from './core/video-player';
4219
4230
  export * from './factory/playback-strategy.factory';
4220
- export * from './strategy/hls.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';
4221
4236
  export * from './interface/playback-strategy.interface';
4222
4237
  export * from './video-events';
4223
4238
 
@@ -4781,9 +4796,19 @@ export declare class BlazeVideoElement extends BlazeWidgetVideoBase {
4781
4796
  }
4782
4797
 
4783
4798
  export declare class PlaybackStrategyFactory {
4784
- 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;
4785
4806
  }
4786
4807
 
4808
+ export interface PlaybackStrategyOptions {
4809
+ overlay?: BlazeLongFormControlsOverlay;
4810
+ loaderDelegate?: LoaderDelegate;
4811
+ }
4787
4812
  export interface PlayResult {
4788
4813
  status: PlayStatus;
4789
4814
  error?: unknown;
@@ -4795,7 +4820,11 @@ export declare enum PlayStatus {
4795
4820
  export interface PlaybackStrategy {
4796
4821
  play(): Promise<PlayResult>;
4797
4822
  pause(): void;
4798
- initialize(videoOverlay: BlazeLongFormControlsOverlay): void;
4823
+ isPaused(): boolean;
4824
+ isEnded(): boolean;
4825
+ getCurrentTime(): number;
4826
+ reset(): void;
4827
+ initialize(options?: PlaybackStrategyOptions): void;
4799
4828
  toggleMute(): void;
4800
4829
  setMuted(muted: boolean): void;
4801
4830
  isMuted(): boolean;
@@ -4805,39 +4834,95 @@ export interface PlaybackStrategy {
4805
4834
  loadSource(src: string, bitRate: number, startingTime: number): Promise<void>;
4806
4835
  unload(): void;
4807
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;
4808
4844
  }
4809
4845
 
4810
- export declare class HLSStrategy implements PlaybackStrategy {
4811
- private hls?;
4812
- private videoOverlay?;
4813
- private video;
4814
- private initialBitrateBps;
4815
- private retryCount;
4816
- private maxRetries;
4817
- private lastTime;
4818
- private beforeContentPlayService;
4819
- private playbackWatchdogTimeout?;
4820
- private loaderTimeout?;
4821
- private recoveryTimeout?;
4822
- private seekRecoveryListener?;
4823
- private boundOnManifestParsed;
4824
- private boundOnBufferAppended;
4825
- private boundOnFragParsed;
4826
- private boundOnLoadedMetadata;
4827
- private boundOnPlaying;
4828
- private boundOnCanPlay;
4829
- private boundOnError;
4830
- private boundOnNativeError;
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;
4831
4909
  constructor(video: HTMLVideoElement);
4832
- initialize(videoOverlay: BlazeLongFormControlsOverlay): void;
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;
4833
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;
4834
4918
  unload(): void;
4835
4919
  destroy(): void;
4836
- private waitForVideoCondition;
4837
4920
  play(): Promise<PlayResult>;
4838
- private startPlaybackWatchdog;
4839
- private handlePlaybackTimeout;
4840
4921
  pause(): void;
4922
+ isPaused(): boolean;
4923
+ isEnded(): boolean;
4924
+ getCurrentTime(): number;
4925
+ reset(): void;
4841
4926
  getDuration(): number;
4842
4927
  isMuted(): boolean;
4843
4928
  seek(clampedSeek: number): void;
@@ -4846,23 +4931,162 @@ export declare class HLSStrategy implements PlaybackStrategy {
4846
4931
  mute(): void;
4847
4932
  unmute(): void;
4848
4933
  toggleFullscreen(): void;
4849
- private updateBuffer;
4850
- private handleManifestParsed;
4851
- private handleBufferAppended;
4852
- private handleFragParsed;
4853
- private handleError;
4854
- private isSlowConnection;
4855
- private nudgePlayback;
4856
- private handleNetworkError;
4857
- private handleOnlineNetworkRecovery;
4858
- private recoverNativeHls;
4859
- private handleMediaError;
4860
- private reloadStream;
4861
- private showLoader;
4862
- private hideLoader;
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;
4863
5024
  private handlePlaying;
4864
- private handleNativeError;
4865
- private handleLoadedMetadata;
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;
4866
5090
  }
4867
5091
 
4868
5092
  export * from './widget-video-base';
@@ -4914,7 +5138,7 @@ export declare abstract class WidgetBaseLayout extends BlazeWidgetScrollable imp
4914
5138
  abstract render(): void;
4915
5139
  widgetType(): WidgetType;
4916
5140
  get thumbnailShape(): ThumbnailShape;
4917
- protected get theme(): IWidgetTheme<StoryPlayerStyle | VideoPlayerStyle | MomentPlayerStyle>;
5141
+ protected get theme(): IWidgetTheme<MomentPlayerStyle | StoryPlayerStyle | VideoPlayerStyle>;
4918
5142
  protected updateActiveLayoutThemesPerItemWithEntity(key: EntitiesType, value: string, theme: IWidgetTheme): void;
4919
5143
  protected setReloadData(options?: ISetWidgetOptions): void;
4920
5144
  set contentIds(value: string);
@@ -5417,7 +5641,6 @@ export declare class BlazeWidgetModal extends BaseWidget {
5417
5641
  constructor(type: ContentType);
5418
5642
  connectedCallback(): void;
5419
5643
  disconnectedCallback(): void;
5420
- private isRealResizeEvent;
5421
5644
  onResize(): void;
5422
5645
  handleOnContentChange(mode: ContentDirection): void;
5423
5646
  handleOnExitButtonClick(): void;
@@ -5617,7 +5840,6 @@ export declare class BlazeWidgetVideoBase extends HTMLElement {
5617
5840
  disconnectedCallback(): void;
5618
5841
  render(): void;
5619
5842
  startEnter(): void;
5620
- startExit(): void;
5621
5843
  endEnter(): void;
5622
5844
  endExit(): void;
5623
5845
  }
@@ -5636,10 +5858,14 @@ export declare class BlazeWidgetVideo extends BlazeWidgetVideoBase {
5636
5858
  loaderTimeoutRefAppending: NodeJS.Timeout | undefined;
5637
5859
  lastErrorExecutionTime: number;
5638
5860
  private beforeContentPlayService;
5861
+ private playbackStrategy?;
5862
+ private playerCommands?;
5863
+ private videoFormat;
5639
5864
  isVideoStartPlaying: boolean;
5640
5865
  isError: boolean;
5641
5866
  isLoaded: boolean;
5642
5867
  isVideoRunning: boolean;
5868
+ private isUnloading;
5643
5869
  maxRetryTimes: number;
5644
5870
  shouldShowImaAd: boolean;
5645
5871
  isCurrentlyTryingToRunImaAd: boolean;
@@ -5660,15 +5886,19 @@ export declare class BlazeWidgetVideo extends BlazeWidgetVideoBase {
5660
5886
  private isEnableInteractions;
5661
5887
  loadClosedCaptions(): Promise<void>;
5662
5888
  getVideoDuration(existingVideo?: HTMLVideoElement): Promise<number>;
5889
+ private determinePosterUrl;
5663
5890
  loadPoster(): void;
5664
5891
  display(): void;
5665
5892
  hide(): void;
5666
5893
  load(loadingType?: LoadingType): Promise<void>;
5667
5894
  private setVideoSource;
5895
+ reloadHLSWithNewUrl(newVideoUrl: string): Promise<void>;
5896
+ private initializeHLSStrategy;
5897
+ private fallbackToNativeVideo;
5898
+ private cleanupHLSStrategy;
5668
5899
  unload(): Promise<void>;
5669
5900
  resetVideoState(): void;
5670
5901
  removeLoader(): void;
5671
- startPlayVideo(video: HTMLVideoElement, maxRetryTimes: number): Promise<void>;
5672
5902
  tryReloadVideo(retryTime: number): void;
5673
5903
  tryToAddLoader(): void;
5674
5904
  play(): Promise<void>;
@@ -5680,18 +5910,18 @@ export declare class BlazeWidgetVideo extends BlazeWidgetVideoBase {
5680
5910
  requestFrameCallback(callback: () => void): void;
5681
5911
  mainElement(): CanvasImageSource;
5682
5912
  get paused(): boolean;
5913
+ get ended(): boolean;
5683
5914
  get muted(): boolean;
5684
5915
  set muted(value: boolean);
5685
5916
  get isAd(): boolean;
5686
5917
  render(): void;
5687
- restartVideo(): void;
5688
5918
  handleAdStarted(): void;
5689
5919
  handleAdEnded(): void;
5690
5920
  loadInteraction(): void;
5691
5921
  onLanguageChange(event: Event): Promise<void>;
5692
5922
  handleInteractionEvent(event: CustomEvent<InteractionAnalyticCustomEvent>): void;
5693
5923
  private tryToPlayAd;
5694
- private updateVideoUrlWithBeforeContentPlay;
5924
+ private isBeingUnloaded;
5695
5925
  }
5696
5926
 
5697
5927
  export declare class BlazeWidgetAd extends BlazeWidgetVideoBase {
@@ -5824,7 +6054,7 @@ export declare class BlazeWidgetMomentModal extends BlazeWidgetModal {
5824
6054
  setModalContent(data: IMoment[], indexOfContentInWidget: number, defaultAdsInfo?: IAdInfo): void;
5825
6055
  onKeyDown(ev: KeyboardEvent): void;
5826
6056
  close(): void;
5827
- open(): void;
6057
+ open(): Promise<void>;
5828
6058
  play(): void;
5829
6059
  setExitButtonDisplay(): void;
5830
6060
  render(): void;
@@ -5912,6 +6142,8 @@ export declare class BlazeWidgetMomentSeekBar extends HTMLElement {
5912
6142
  private progressBarFill;
5913
6143
  private progressBarKnob;
5914
6144
  private isMouseIn;
6145
+ private seekingTimeout?;
6146
+ private readonly SEEKING_DEBOUNCE_MS;
5915
6147
  constructor(video: BlazeWidgetVideo | BlazeWidgetAd, seekBarStyle: BlazeMomentsPlayerSeekBarStyle);
5916
6148
  static get observedAttributes(): string[];
5917
6149
  attributeChangedCallback(name: string, oldValue: string, _newValue: string): void;
@@ -5940,6 +6172,9 @@ export declare class BlazeWidgetMomentSeekBar extends HTMLElement {
5940
6172
  private createPlaybackPart;
5941
6173
  private updateProgressBarStyles;
5942
6174
  render(): void;
6175
+ private setupVideoEventListeners;
6176
+ private startSeekingLoader;
6177
+ private stopSeekingLoader;
5943
6178
  }
5944
6179
 
5945
6180
  interface ButtonElementOptions {
@@ -6183,6 +6418,7 @@ export declare class BlazeWidgetStory extends BlazeWidgetContent {
6183
6418
  isStoryLoadCompletedTriggered: boolean;
6184
6419
  isStoryActive: boolean;
6185
6420
  isResumeOnFocusExecuted: boolean;
6421
+ isUnloading: boolean;
6186
6422
  refWidget: BlazeWidgetStory[] | undefined;
6187
6423
  ctaModal: BlazeWidgetCtaModal;
6188
6424
  isCtaWasClickedOrSwiped: boolean;
@@ -6221,6 +6457,7 @@ export declare class BlazeWidgetStory extends BlazeWidgetContent {
6221
6457
  totalPlayStopwatch: Stopwatch;
6222
6458
  shadowTopElement: HTMLDivElement;
6223
6459
  navigationTimeout: NodeJS.Timeout | null;
6460
+ prefetchTimeout: NodeJS.Timeout | null;
6224
6461
  lastPageIndexToResume: number;
6225
6462
  elementsToHideOnWebAds: (HTMLElement | undefined)[];
6226
6463
  elementsToHideOnImaAds: (HTMLElement | undefined)[];
@@ -6282,7 +6519,7 @@ export declare class BlazeWidgetStory extends BlazeWidgetContent {
6282
6519
  playPage(pageIndexToPlayNext: number): void;
6283
6520
  updatePublishedDate(index?: number): void;
6284
6521
  switchToPage(newPageIndex: number): void;
6285
- startPage(indexToPlay: number): void;
6522
+ startPage(indexToPlay: number): Promise<void>;
6286
6523
  private shouldGetNewBannerAd;
6287
6524
  unload(): void;
6288
6525
  displayCurrentStoryPageAndHideTheRest(): void;