@wscsports/blaze-web-sdk 0.34.2 → 0.35.2

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.
@@ -60,11 +60,17 @@ export interface IndicatorStyle {
60
60
  textSize: string;
61
61
  letterSpacing: string;
62
62
  font: string;
63
+ fontWeight?: FontWeightType;
63
64
  isVisible: boolean;
64
65
  width?: number;
65
66
  height?: number;
66
67
  padding: string;
67
68
  positionOffset?: PartialPositionOffset;
69
+ icon?: {
70
+ url: string;
71
+ color?: string;
72
+ size?: string;
73
+ };
68
74
  }
69
75
  export interface LayoutStyle {
70
76
  thumbnailShape: ThumbnailShape;
@@ -74,6 +80,7 @@ export interface LayoutStyle {
74
80
  itemRatio: number;
75
81
  isSkeleton: boolean;
76
82
  labelStyle: LabelStyle;
83
+ startTimeStyle: StartTimeStyle;
77
84
  lines: number;
78
85
  wordBreak: string;
79
86
  horizontalItemsSpacing: number;
@@ -85,9 +92,33 @@ export interface LayoutStyle {
85
92
  statusLiveUnreadStyle: IndicatorStyle;
86
93
  statusReadStyle: IndicatorStyle;
87
94
  statusUnreadStyle: IndicatorStyle;
95
+ statusUpcomingStyle: IndicatorStyle;
96
+ statusEndedStyle: IndicatorStyle;
88
97
  statusIndicatorPosition: PositionType;
89
98
  badgeIndicatorStyle: IndicatorStyle;
90
99
  badgePosition: PositionType;
100
+ playButtonStyle: ThumbnailPlayButtonStyle;
101
+ durationBadgeStyle: DurationBadgeStyle;
102
+ }
103
+ export type ThumbnailPlayButtonColorMode = "light" | "dark";
104
+ export interface ThumbnailPlayButtonStyle {
105
+ isVisible: boolean;
106
+ colorMode: ThumbnailPlayButtonColorMode;
107
+ iconColor?: string;
108
+ backgroundColor?: string;
109
+ size?: string;
110
+ iconSize?: string;
111
+ }
112
+ export interface DurationBadgeStyle {
113
+ isVisible: boolean;
114
+ textColor: string;
115
+ backgroundColor: string;
116
+ font: string;
117
+ fontSize: string;
118
+ borderRadius: string;
119
+ padding: string;
120
+ position: PositionType;
121
+ positionOffset?: PartialPositionOffset;
91
122
  }
92
123
  export interface LabelStyle {
93
124
  isVisible: boolean;
@@ -103,12 +134,33 @@ export interface LabelStyle {
103
134
  textAlign?: string;
104
135
  position: PositionType;
105
136
  }
137
+ export type TitleImageSourceMode = "dynamic" | "static";
138
+ export type TitleImageConfig = {
139
+ isVisible: boolean;
140
+ size: number;
141
+ sourceMode: TitleImageSourceMode;
142
+ staticUrl?: string;
143
+ dynamicFallbackUrl?: string;
144
+ };
145
+ export interface StartTimeStyle {
146
+ isVisible: boolean;
147
+ backgroundColor: string;
148
+ textColor: string;
149
+ padding: string;
150
+ borderRadius: string;
151
+ font: string;
152
+ fontSize: string;
153
+ fontWeight: FontWeightType;
154
+ letterSpacing: string;
155
+ position: PositionType;
156
+ }
106
157
  export interface StoryPlayerStyle {
107
158
  titleVisible: boolean;
108
159
  titleFont: string;
109
160
  titleFontSize: string;
110
161
  titleFontSizeEmbedded: string;
111
162
  titleColor: string;
163
+ titleImage: TitleImageConfig;
112
164
  publishedDateVisible: boolean;
113
165
  publishedDateFont: string;
114
166
  publishedDateFontSize: string;
@@ -283,7 +335,75 @@ export interface VideoPlayerStyle {
283
335
  cta: BlazeVideosPlayerCtaStyle;
284
336
  seekBar: BlazeVideosPlayerSeekBarStyle;
285
337
  icons: BlazeVideoIconsStyle;
338
+ /**
339
+ * Status indicator shown in player header (LIVE/UPCOMING/ENDED chip)
340
+ * Matches Android's BlazeVideosPlayerStatusIndicatorStyle
341
+ */
342
+ statusIndicator: BlazeVideosPlayerStatusIndicatorStyle;
343
+ /**
344
+ * Back-to-live button for live stream playback
345
+ * Shows "Live" when at edge, "Back to Live" when behind
346
+ * Matches Android's BlazeVideosPlayerBackToLiveButtonStyle
347
+ */
348
+ backToLiveButton: BlazeVideosPlayerBackToLiveButtonStyle;
286
349
  }
350
+ /**
351
+ * Position configuration for status indicator in video player
352
+ */
353
+ export type BlazeVideosPlayerStatusIndicatorPositionStyle = {
354
+ top: string;
355
+ left: string;
356
+ right: string;
357
+ };
358
+ /**
359
+ * Container style for status indicator (for inline positioning next to title)
360
+ */
361
+ export type BlazeVideosPlayerStatusIndicatorContainerStyle = {
362
+ gap?: string;
363
+ alignItems?: string;
364
+ display?: string;
365
+ };
366
+ /**
367
+ * Status indicator style for video player (LIVE/UPCOMING/ENDED chips)
368
+ */
369
+ export type BlazeVideosPlayerStatusIndicatorStyle = {
370
+ isVisible: boolean;
371
+ padding: string;
372
+ position: BlazeVideosPlayerStatusIndicatorPositionStyle;
373
+ containerStyle?: BlazeVideosPlayerStatusIndicatorContainerStyle;
374
+ streamStates: {
375
+ upcoming: IndicatorStyle;
376
+ live: IndicatorStyle;
377
+ ended: IndicatorStyle;
378
+ };
379
+ upcomingDateStyle: IndicatorStyle;
380
+ };
381
+ /**
382
+ * Single state style for back-to-live button
383
+ */
384
+ export type BlazeVideosPlayerBackToLiveButtonStateStyle = {
385
+ text: string;
386
+ textColor: string;
387
+ textSize: string;
388
+ font: string;
389
+ backgroundColor: string;
390
+ borderRadius: string;
391
+ icon?: {
392
+ url: string;
393
+ color?: string;
394
+ };
395
+ };
396
+ /**
397
+ * Back-to-live button style for live stream playback
398
+ */
399
+ export type BlazeVideosPlayerBackToLiveButtonStyle = {
400
+ margins: string;
401
+ padding: string;
402
+ playbackStates: {
403
+ atLiveEdgeState: BlazeVideosPlayerBackToLiveButtonStateStyle;
404
+ behindLiveState: BlazeVideosPlayerBackToLiveButtonStateStyle;
405
+ };
406
+ };
287
407
  export type BlazeVideosPlayerHeadingTextStyle = {
288
408
  textStyle: BlazeTextStyle;
289
409
  contentSource: "TITLE";
@@ -383,6 +503,99 @@ export interface PositionOffset {
383
503
  }
384
504
  export type PartialPositionOffset = Partial<PositionOffset>;
385
505
  export type IconsPositionType = "HORIZONTAL" | "VERTICAL";
506
+ /**
507
+ * Type of video content
508
+ * - Video: On-demand video content
509
+ * - Stream: Live streaming content
510
+ */
511
+ export type VideoContentType = "Video" | "Stream";
512
+ /**
513
+ * Video content filtering options
514
+ * Use to filter video widget content by content type and stream state
515
+ *
516
+ * @example
517
+ * // Using presets (recommended for common cases)
518
+ * videoFilters: VideoFilters.liveOnly() // Only live streams
519
+ * videoFilters: VideoFilters.watchable() // Videos + live streams
520
+ * videoFilters: VideoFilters.vodOnly() // Only on-demand videos
521
+ *
522
+ * @example
523
+ * // Using custom filters (for advanced cases)
524
+ * videoFilters: {
525
+ * contentTypes: ['Stream'],
526
+ * streamStates: ['Live', 'Upcoming']
527
+ * }
528
+ */
529
+ export interface IVideoFilterOptions {
530
+ contentTypes?: VideoContentType[];
531
+ streamStates?: Exclude<StreamState, null>[];
532
+ }
533
+ /**
534
+ * Video filter presets for common filtering scenarios
535
+ *
536
+ * @example
537
+ * // Using builder pattern (recommended)
538
+ * const filters = VideoFilterBuilder();
539
+ * videoFilters: filters.liveOnly() // Only live streams
540
+ * videoFilters: filters.watchable() // Videos + live streams
541
+ *
542
+ * @example
543
+ * // Using custom filter with validation
544
+ * const filters = VideoFilterBuilder();
545
+ * videoFilters: filters.custom({
546
+ * contentTypes: ['Stream'],
547
+ * streamStates: ['Live', 'Upcoming']
548
+ * })
549
+ *
550
+ * @example
551
+ * // Using direct object (validation happens in SDK)
552
+ * videoFilters: {
553
+ * contentTypes: ['Stream'],
554
+ * streamStates: ['Live', 'Upcoming']
555
+ * }
556
+ */
557
+ export declare class VideoFilters {
558
+ /**
559
+ * Only show currently live streams
560
+ */
561
+ static liveOnly(): IVideoFilterOptions;
562
+ /**
563
+ * Only show upcoming scheduled streams
564
+ */
565
+ static upcomingOnly(): IVideoFilterOptions;
566
+ /**
567
+ * Only show ended streams (replays)
568
+ */
569
+ static endedOnly(): IVideoFilterOptions;
570
+ /**
571
+ * Show all streams regardless of state (live, upcoming, ended)
572
+ */
573
+ static allStreams(): IVideoFilterOptions;
574
+ /**
575
+ * Only show on-demand video content (not streams)
576
+ */
577
+ static vodOnly(): IVideoFilterOptions;
578
+ /**
579
+ * Show watchable content: on-demand videos + live streams
580
+ * Excludes upcoming streams and ended streams (no replay URLs)
581
+ */
582
+ static watchable(): IVideoFilterOptions;
583
+ /**
584
+ * @internal
585
+ * Convert filter options to API query string format
586
+ */
587
+ static toApiFormat(options?: IVideoFilterOptions): {
588
+ contentTypes?: string;
589
+ streamStates?: string;
590
+ };
591
+ /**
592
+ * @internal
593
+ * Validate video filter options
594
+ * Called automatically by the SDK when filters are used
595
+ * @throws Error if filter configuration is invalid
596
+ */
597
+ static validate(options: IVideoFilterOptions): void;
598
+ }
386
599
  export type BlazeAbTestType = {
387
600
  id: string;
388
601
  variant: string;
@@ -423,7 +636,7 @@ export interface BlazeDataSourceType {
423
636
  text?: string;
424
637
  }
425
638
  export type LocaleDirectionType = "LTR" | "RTL";
426
- export type OrderType = "Manual" | "AtoZ" | "ZtoA" | "RecentlyUpdatedFirst" | "RecentlyUpdatedLast" | "RecentlyCreatedFirst" | "RecentlyCreatedLast" | "Random";
639
+ export type OrderType = "Manual" | "AtoZ" | "ZtoA" | "RecentlyUpdatedFirst" | "RecentlyUpdatedLast" | "RecentlyCreatedFirst" | "RecentlyCreatedLast" | "Random" | "Upcoming" | "RecentlyStartingFirst" | "RecentlyStartingLast" | "RecentlyStartedFirst" | "RecentlyStartedLast";
427
640
  export type ContentOrderType = "LIVE_CHIP" | "STORY_TITLE" | "PUBLISHED_DATE";
428
641
  export type BlazePersonalizedIds = {
429
642
  type: "ids";
@@ -439,6 +652,18 @@ export type BlazePersonalized = BlazePersonalizedIds | BlazePersonalizedLabels;
439
652
  export type PrefetchingPolicyType = "low" | "default";
440
653
  export type ContentAspectRatio = "Vertical" | "Horizontal";
441
654
  export type StoryDirectionType = "PREV_STORY" | "NEXT_STORY" | "PREV_PAGE" | "NEXT_PAGE";
655
+ /**
656
+ * Stream state indicates the current lifecycle stage of a live stream
657
+ *
658
+ * @remarks
659
+ * - 'Upcoming': Stream is scheduled but not yet started (waiting room)
660
+ * - 'Live': Stream is currently broadcasting (live playback)
661
+ * - 'Ended': Stream has finished (replay or ended state)
662
+ * - null: Regular content (not a stream -> video)
663
+ *
664
+ * Note: Uses capitalized format to match API response format
665
+ */
666
+ export type StreamState = "Upcoming" | "Live" | "Ended" | null;
442
667
  export type ThumbnailApiType = "SquareIcon" | "VerticalTwoByThree" | "Gif" | "AnimatedThumbnailPoster" | "MainThumbnail";
443
668
  export type ThumbnailType = "SQUARE_ICON" | "VERTICAL_TWO_BY_THREE" | "GIF" | "ANIMATED_THUMBNAIL_POSTER" | "CUSTOM";
444
669
  export type ThumbnailShape = "Circle" | "Rectangle";
@@ -475,6 +700,7 @@ export interface IWidgetViewOptionsBase {
475
700
  shouldOrderWidgetByReadStatus?: boolean;
476
701
  contentIds?: string[];
477
702
  actionHandlers?: ActionHandler[];
703
+ videoFilters?: IVideoFilterOptions;
478
704
  }
479
705
  export interface IWidgetViewOptionsWithLabels extends IWidgetViewOptionsBase {
480
706
  labels: string | string[] | BlazeWidgetLabel;
@@ -591,6 +817,7 @@ export interface IContent {
591
817
  extraInfo: ExtraInfo;
592
818
  followEntities?: BlazeFollowEntity[];
593
819
  retrievedLanguages?: RetrievedLanguages;
820
+ titleImageUrl?: string;
594
821
  }
595
822
  export interface IBlazeContent {
596
823
  id: string;
@@ -601,6 +828,7 @@ export interface IBlazeContent {
601
828
  hasViewed: boolean;
602
829
  type?: string;
603
830
  entities?: ContentEntities;
831
+ titleImageUrl?: string;
604
832
  }
605
833
  export interface IRendition {
606
834
  url: string;
@@ -646,6 +874,7 @@ export interface IBlazeSDKOptions {
646
874
  previewMomentUrl?: string;
647
875
  doNotTrack?: boolean;
648
876
  disableAnalytics?: boolean;
877
+ disableUserActivity?: boolean;
649
878
  geoLocation?: string;
650
879
  staticContent?: boolean;
651
880
  staticContentType?: ContentType;
@@ -665,6 +894,8 @@ export interface IBlazeSDKOptions {
665
894
  disableAutoLoadingContent?: boolean;
666
895
  followedEntities?: string[];
667
896
  preferredLanguage?: string;
897
+ /** Timeout in milliseconds for CDN requests. Minimum value is 10000ms — values below this threshold are ignored. */
898
+ cdnTimeout?: number;
668
899
  }
669
900
  export interface IDataSourceBuilder {
670
901
  labels: (params: LabelsDataSourceParams) => BlazeDataSourceType;
@@ -721,6 +952,56 @@ export type BlazeVideoIconsStyle = BaseBlazeIcons & {
721
952
  nextVideo: string;
722
953
  };
723
954
  };
955
+ /**
956
+ * Builder interface for creating video filter configurations
957
+ * Provides a fluent API for common filtering scenarios
958
+ *
959
+ * @example
960
+ * // Builder pattern (recommended)
961
+ * const filters = VideoFilterBuilder();
962
+ * videoFilters: filters.liveOnly()
963
+ * videoFilters: filters.watchable()
964
+ *
965
+ * @example
966
+ * // Custom filter with validation
967
+ * videoFilters: filters.custom({
968
+ * contentTypes: ['Video', 'Stream'],
969
+ * streamStates: ['Live', 'Ended']
970
+ * })
971
+ */
972
+ export interface IVideoFilterBuilder {
973
+ /**
974
+ * Only show currently live streams
975
+ */
976
+ liveOnly(): IVideoFilterOptions;
977
+ /**
978
+ * Only show upcoming scheduled streams
979
+ */
980
+ upcomingOnly(): IVideoFilterOptions;
981
+ /**
982
+ * Only show ended streams (replays)
983
+ */
984
+ endedOnly(): IVideoFilterOptions;
985
+ /**
986
+ * Show all streams regardless of state (live, upcoming, ended)
987
+ */
988
+ allStreams(): IVideoFilterOptions;
989
+ /**
990
+ * Only show on-demand video content (not streams)
991
+ */
992
+ vodOnly(): IVideoFilterOptions;
993
+ /**
994
+ * Show watchable content: on-demand videos + live streams
995
+ * Excludes upcoming streams and ended streams (no replay URLs)
996
+ */
997
+ watchable(): IVideoFilterOptions;
998
+ /**
999
+ * Create custom filter configuration with validation
1000
+ * @param options - Custom filter options
1001
+ * @throws Error if filter configuration is invalid
1002
+ */
1003
+ custom(options: IVideoFilterOptions): IVideoFilterOptions;
1004
+ }
724
1005
  export interface IWidgetLabelBuilder {
725
1006
  singleLabel(label: string): BlazeWidgetLabel;
726
1007
  mustInclude(...labels: Array<string | BlazeWidgetLabel>): BlazeWidgetLabel;
@@ -814,6 +1095,7 @@ export declare function addDelegateListener(type: string, listener: EventListene
814
1095
  export declare const Delegations: typeof Delegation;
815
1096
  export declare function LabelBuilder(): IWidgetLabelBuilder;
816
1097
  export declare function DataSourceBuilder(): IDataSourceBuilder;
1098
+ export declare function VideoFilterBuilder(): IVideoFilterBuilder;
817
1099
  export declare function pauseCurrentPlayer(): void;
818
1100
  export declare function resumeCurrentPlayer(): void;
819
1101
  export declare function setGoogleCustomNativeAdsHandler(handler: CustomNativeAdHandler): void;
@@ -844,6 +1126,16 @@ export declare function appendContentToPlayer(contentType: ContentType, dataSour
844
1126
  * @param value - true to disable analytics, false to enable
845
1127
  */
846
1128
  export declare function setDisableAnalytics(value: boolean): void;
1129
+ /**
1130
+ * Clears all user activity data from the device's local storage only.
1131
+ */
1132
+ export declare function clearLocalUserActivity(): Promise<void>;
1133
+ /**
1134
+ * Enables or disables user activity tracking and syncing at runtime.
1135
+ * Behavior when toggled:
1136
+ * @param value - true to disable user activity, false to enable
1137
+ */
1138
+ export declare function setDisableUserActivity(value: boolean): void;
847
1139
  declare const _default: {
848
1140
  Initialize: typeof Initialize;
849
1141
  WidgetGridView: typeof WidgetGridView;
@@ -860,6 +1152,7 @@ declare const _default: {
860
1152
  setOnItemClick: typeof setOnItemClick;
861
1153
  LabelBuilder: typeof LabelBuilder;
862
1154
  DataSourceBuilder: typeof DataSourceBuilder;
1155
+ VideoFilterBuilder: typeof VideoFilterBuilder;
863
1156
  Delegations: typeof Delegation;
864
1157
  setGoogleCustomNativeAdsHandler: typeof setGoogleCustomNativeAdsHandler;
865
1158
  setImaHandler: typeof setImaHandler;
@@ -875,6 +1168,8 @@ declare const _default: {
875
1168
  isInitialized: () => boolean;
876
1169
  setBeforeContentPlayCallback: typeof setBeforeContentPlayCallback;
877
1170
  appendContentToPlayer: typeof appendContentToPlayer;
1171
+ clearLocalUserActivity: typeof clearLocalUserActivity;
1172
+ setDisableUserActivity: typeof setDisableUserActivity;
878
1173
  };
879
1174
 
880
1175
  export {