@tivio/sdk-react 9.2.0-alpha.4 → 9.3.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/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ import type { PaletteType } from '@material-ui/core';
11
11
  import { default as React_2 } from 'react';
12
12
  import { RecommendationsQuery } from '@algolia/recommend';
13
13
  import type { TagManagerArgs } from 'react-gtm-module';
14
+ import type { Timestamp } from '@firebase/firestore-types';
14
15
 
15
16
  export declare interface ActivatedPromotion {
16
17
  id: string;
@@ -607,6 +608,10 @@ export declare interface BannerProps {
607
608
  */
608
609
  export declare type BannerPropsPartial = Partial<BannerProps>;
609
610
 
611
+ declare interface BaseWidgetControlPayload {
612
+ widgetPath: string;
613
+ }
614
+
610
615
  /**
611
616
  * @public
612
617
  */
@@ -661,6 +666,35 @@ export declare interface CancellingMonetizationsSummaryItem {
661
666
  cancellingUsers: number;
662
667
  }
663
668
 
669
+ declare interface ChangeStateResponse {
670
+ success: boolean;
671
+ }
672
+
673
+ declare interface ChangeWidgetStatePayload extends BaseWidgetControlPayload {
674
+ prevState: InteractiveWidgetState;
675
+ targetState: InteractiveWidgetState;
676
+ }
677
+
678
+ export declare interface ChangeWidgetStateRequest {
679
+ /** Path to the widget instance document */
680
+ widgetPath: string;
681
+ /** The state the client believes the widget is currently in */
682
+ prevState: InteractiveWidgetState;
683
+ /** The desired target state to transition to */
684
+ targetState: InteractiveWidgetState;
685
+ /** Active scene id */
686
+ activeSceneId?: string;
687
+ /** Audience delay in seconds */
688
+ audienceDelay?: number;
689
+ /** Time in seconds for the audience to answer the question */
690
+ answerTime?: number;
691
+ }
692
+
693
+ declare interface ChangeWidgetStateRequest_2 {
694
+ action: 'changeState';
695
+ payload: ChangeWidgetStatePayload;
696
+ }
697
+
664
698
  /**
665
699
  * @public
666
700
  * @deprecated this channel structure is not used anymore (don't confuse with tv channels, which are used).
@@ -714,6 +748,11 @@ export declare interface ChurnedMonetizationsSummaryItem {
714
748
  expiredUsers: number;
715
749
  }
716
750
 
751
+ export declare enum CloudflareStreamingPurchaseStatus {
752
+ PAID = "paid",
753
+ FREE = "free"
754
+ }
755
+
717
756
  /**
718
757
  * @public
719
758
  */
@@ -1014,6 +1053,18 @@ export declare interface ConversionsTargetItem {
1014
1053
 
1015
1054
  export declare type CountdownScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.COUNTDOWN>;
1016
1055
 
1056
+ /**
1057
+ * Maps supported country codes (ISO 3166-1 alpha-2) to their primary language codes (ISO 639-1).
1058
+ * Used to determine the default language settings for specific countries.
1059
+ * @example
1060
+ * CountryToLanguageMap['CZ'] // Returns LangCode.CS for Czech Republic
1061
+ */
1062
+ export declare const CountryToLangCodeMap: {
1063
+ CZ: LangCode;
1064
+ PL: LangCode;
1065
+ SK: LangCode;
1066
+ };
1067
+
1017
1068
  /**
1018
1069
  * @public
1019
1070
  * @TODO move somewhere else
@@ -1034,11 +1085,11 @@ export declare const createPubSub: () => PubSub;
1034
1085
  * Fetch & load CommonJS remote module.
1035
1086
  * @public
1036
1087
  */
1037
- export declare const createRemotePackageLoader: () => (secret: string, conf: InternalConfig, checkBundleCharCount?: boolean) => Promise<TivioBundle>;
1088
+ export declare const createRemotePackageLoader: () => (secret: string, conf: InternalConfig, checkBundleCharCount?: boolean, skipCache?: boolean) => Promise<TivioBundle>;
1038
1089
 
1039
1090
  export declare const createTivio: () => (conf: SdkReactConfig) => Promise<RemoteBundleState>;
1040
1091
 
1041
- export declare const createUseRemoteBundle: () => (sdkReactConfig: SdkReactConfig, checkBundleCharCount?: boolean) => RemoteBundleState;
1092
+ export declare const createUseRemoteBundle: () => (sdkReactConfig: SdkReactConfig, checkBundleCharCount?: boolean, skipCache?: boolean) => RemoteBundleState;
1042
1093
 
1043
1094
  export declare interface CreateUserPayload {
1044
1095
  displayName?: string;
@@ -1114,7 +1165,6 @@ export declare enum CustomerId {
1114
1165
  GRAPE = "GRAPE",
1115
1166
  HODINA_DEJEPICHU = "HODINA_DEJEPICHU",
1116
1167
  INVESTICNI_PRUVODCE = "INVESTICNI_PRUVODCE",
1117
- INVESTOREES = "INVESTOREES",
1118
1168
  JOJ = "JOJ",
1119
1169
  KLUCI_Z_PRAHY = "KLUCI_Z_PRAHY",
1120
1170
  MALL = "MALL",
@@ -1159,7 +1209,8 @@ export declare enum CustomerId {
1159
1209
  BEAT_SEXISM = "BEAT_SEXISM",
1160
1210
  KAROL_A_KVIDO = "KAROL_A_KVIDO",
1161
1211
  UZ_BUDU = "UZ_BUDU",
1162
- PRIMA = "PRIMA"
1212
+ PRIMA = "PRIMA",
1213
+ NORA_FRIDRICHOVA = "NORA_FRIDRICHOVA"
1163
1214
  }
1164
1215
 
1165
1216
  export declare interface CustomScript {
@@ -1291,6 +1342,8 @@ export declare enum DrmProvider {
1291
1342
  * Original oktagon stream provider.
1292
1343
  *
1293
1344
  * https://streamonline.pl
1345
+ *
1346
+ * @deprecated oktagon no longer uses this drm provider.
1294
1347
  */
1295
1348
  STREAMONLINE = "streamonline"
1296
1349
  }
@@ -1339,6 +1392,18 @@ export declare interface EditMessageOptions extends Omit<AddMessageOptions, 'par
1339
1392
  videoTime?: number;
1340
1393
  }
1341
1394
 
1395
+ export declare interface EmailNotification {
1396
+ id: string;
1397
+ name: string;
1398
+ targeting: NotificationTargeting | null;
1399
+ templateId: string;
1400
+ thumbnailUrl?: string;
1401
+ triggerType: NotificationTriggerType;
1402
+ scheduleTime?: Date;
1403
+ status?: NotificationStatus;
1404
+ substitutions: NotificationSubstitution[];
1405
+ }
1406
+
1342
1407
  /**
1343
1408
  * Represents a SendGrid transactional template.
1344
1409
  */
@@ -1434,8 +1499,8 @@ export declare type EmbedScreenPostMessageFn = <T extends EmbedScreenPostMessage
1434
1499
  */
1435
1500
  export declare interface EmitterInterface {
1436
1501
  isSupported: (even: string) => boolean;
1437
- addListener: <T = any>(event: string, cb: (value: T) => Empty_2) => void;
1438
- removeListener: <T = any>(event: string, cb: (value: T) => Empty_2) => void;
1502
+ addListener: <T = unknown>(event: string, cb: (value: T) => Empty_2) => void;
1503
+ removeListener: <T = unknown>(event: string, cb: (value: T) => Empty_2) => void;
1439
1504
  }
1440
1505
 
1441
1506
  /**
@@ -1460,6 +1525,11 @@ export declare type Events = {
1460
1525
  'on-error': Error;
1461
1526
  };
1462
1527
 
1528
+ export declare interface ExtensionMetadata {
1529
+ purchaseStatus: CloudflareStreamingPurchaseStatus;
1530
+ activeVideoId?: string;
1531
+ }
1532
+
1463
1533
  /**
1464
1534
  * @public
1465
1535
  */
@@ -1468,6 +1538,23 @@ export declare type ExternalTvConfig = {
1468
1538
  splashScreenBackgroundColor?: string;
1469
1539
  };
1470
1540
 
1541
+ export declare interface FavoriteTagWithData {
1542
+ content: Tag;
1543
+ type: 'tag';
1544
+ }
1545
+
1546
+ export declare interface FavoriteVideoWithData {
1547
+ content: Video;
1548
+ type: 'video';
1549
+ }
1550
+
1551
+ /**
1552
+ * @public
1553
+ */
1554
+ export declare type FavoriteWithData = FavoriteVideoWithData | (FavoriteTagWithData & {
1555
+ profileId?: string;
1556
+ });
1557
+
1471
1558
  /**
1472
1559
  * @throws if fetch fails
1473
1560
  * @public
@@ -1529,6 +1616,24 @@ export declare type FrequencyInfo = {
1529
1616
  value: number;
1530
1617
  };
1531
1618
 
1619
+ export declare interface GenerateSourceRequest {
1620
+ profileId: string;
1621
+ videoId: string;
1622
+ protocol: VideoSourceProtocol;
1623
+ sessionType: SessionType;
1624
+ extensionMetadata: ExtensionMetadata;
1625
+ }
1626
+
1627
+ export declare interface GenerateWidgetJoinCodeRequest {
1628
+ action: 'generateWidgetJoinCode';
1629
+ payload: BaseWidgetControlPayload;
1630
+ }
1631
+
1632
+ declare interface GenerateWidgetJoinCodeResponse {
1633
+ code: string;
1634
+ qrCodeUri: string;
1635
+ }
1636
+
1532
1637
  /**
1533
1638
  * On call error interface for front-end.
1534
1639
  * Do not use it / throw it from @tivio/api.
@@ -1725,6 +1830,14 @@ export declare interface GetSourceUrlResponse {
1725
1830
 
1726
1831
  export declare type GetTilesInRowResponse<U extends NextPageParamType = NextPageParamType> = PaginatedResponse<TileData, U>;
1727
1832
 
1833
+ export declare interface GetUserProfileDataOptions {
1834
+ /**
1835
+ * If true, the data will be returned for all user profiles.
1836
+ * If false, the data will be returned only for the active user profile.
1837
+ */
1838
+ ignoreActiveUserProfile?: boolean;
1839
+ }
1840
+
1728
1841
  export declare interface GetUserRssUrlRequest {
1729
1842
  organizationId: string;
1730
1843
  }
@@ -1947,6 +2060,7 @@ export declare interface InteractiveWidget<T extends InteractiveWidgetScene = In
1947
2060
  readonly isWaitingForStart: boolean;
1948
2061
  answerQuestion(answerId: string): void;
1949
2062
  submitAnswer(request: Pick<SubmitAnswerRequest, 'answerOptionId' | 'answerText'>): Promise<void>;
2063
+ verifyJoinCode(joinCode: string, shouldJoinPlayer?: boolean): Promise<boolean>;
1950
2064
  destroy(): void;
1951
2065
  }
1952
2066
 
@@ -1972,6 +2086,7 @@ export declare interface InteractiveWidgetSceneBase<TType extends InteractiveWid
1972
2086
  type: TType;
1973
2087
  name: Translation;
1974
2088
  metadata: SceneMetadata<TType>;
2089
+ state: InteractiveWidgetState;
1975
2090
  }
1976
2091
 
1977
2092
  export declare enum InteractiveWidgetSceneTemplateType {
@@ -2197,6 +2312,12 @@ export declare interface LeaderboardPlayer {
2197
2312
 
2198
2313
  export declare type LeaderboardScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.LEADERBOARD>;
2199
2314
 
2315
+ export declare interface LeaderboardsRequest {
2316
+ widgetPath: string;
2317
+ lastQuestionIndex: number;
2318
+ allPlayers?: boolean;
2319
+ }
2320
+
2200
2321
  /**
2201
2322
  * @public
2202
2323
  */
@@ -2340,6 +2461,21 @@ export declare interface MallTvExternals {
2340
2461
  mallTvEntityId: string;
2341
2462
  }
2342
2463
 
2464
+ /**
2465
+ * Response for {@link ManagementGenerateSourceRequest}
2466
+ * @private
2467
+ * @example ```json
2468
+ * {
2469
+ * "sessionId": "f6439376-bc57-4891-ac64-4dde4254a423",
2470
+ * "url": "https://live.streaming.tivio.studio/live/ol24ae7lQ4ES1PN6UYSk/tRRu9BMn3eTTX22iTyLz/f6439376-bc57-4891-ac64-4dde4254a423/index.m3u8"
2471
+ * }
2472
+ * ```
2473
+ */
2474
+ export declare interface ManagementGenerateSourceResponse {
2475
+ sessionId: string;
2476
+ url: string;
2477
+ }
2478
+
2343
2479
  /**
2344
2480
  * @public
2345
2481
  */
@@ -2640,17 +2776,11 @@ export declare type NoGraphicsScene = InteractiveWidgetSceneBase<InteractiveWidg
2640
2776
  */
2641
2777
  export declare type NonAdSourceType = Exclude<SourceType, SourceType.ADVERTISEMENT>;
2642
2778
 
2643
- declare interface Notification_2 {
2644
- id: string;
2645
- name: string;
2646
- targeting: NotificationTargeting | null;
2647
- templateId: string;
2648
- thumbnailUrl?: string;
2649
- triggerType: NotificationTriggerType;
2650
- scheduleTime?: Date;
2651
- status?: NotificationStatus;
2652
- substitutions: NotificationSubstitution[];
2653
- }
2779
+ declare type Notification_2 = {
2780
+ type: NotificationType.PUSH;
2781
+ } & SchedulePushNotificationPayload | {
2782
+ type?: NotificationType.EMAIL;
2783
+ } & EmailNotification;
2654
2784
  export { Notification_2 as Notification }
2655
2785
 
2656
2786
  export declare interface NotificationDuration {
@@ -2721,6 +2851,11 @@ export declare interface NotificationTargeting {
2721
2851
 
2722
2852
  export declare type NotificationTriggerType = 'scheduled' | 'manual' | 'purchaseStatusChange' | 'duration' | 'userRegistration';
2723
2853
 
2854
+ export declare enum NotificationType {
2855
+ PUSH = "PUSH",
2856
+ EMAIL = "EMAIL"
2857
+ }
2858
+
2724
2859
  /**
2725
2860
  * @public
2726
2861
  */
@@ -2825,6 +2960,7 @@ export declare interface OrganizationSettingsField extends OrganizationResponsiv
2825
2960
  };
2826
2961
  rss?: {
2827
2962
  title?: string;
2963
+ enabled?: boolean;
2828
2964
  };
2829
2965
  /**
2830
2966
  * Setting for EPG screen on web
@@ -2854,6 +2990,9 @@ export declare interface OrganizationSettingsField extends OrganizationResponsiv
2854
2990
  };
2855
2991
  };
2856
2992
  voucher?: VoucherPageConfiguration;
2993
+ pushNotifications?: {
2994
+ enabled?: boolean;
2995
+ };
2857
2996
  }
2858
2997
 
2859
2998
  /**
@@ -3117,9 +3256,8 @@ export declare interface PlayerEngineInterface {
3117
3256
  stop(): Promise<void>;
3118
3257
  addEventListener<T>(event: PlayerEngineEvent, callback: PlayerEngineListener<T>): void;
3119
3258
  addEventListener(event: 'statechange', callback: PlayerEngineListener<PlayerState>): void;
3120
- addEventListener(event: 'bufferingchange', callback: PlayerEngineListener<boolean>): void;
3259
+ addEventListener(event: 'bufferingchange' | 'togglefullscreen', callback: PlayerEngineListener<boolean>): void;
3121
3260
  addEventListener(event: 'bufferedinfochange', callback: PlayerEngineListener<BufferPercentChunk[]>): void;
3122
- addEventListener(event: 'togglefullscreen', callback: PlayerEngineListener<boolean>): void;
3123
3261
  removeEventListener<T>(event: PlayerEngineEvent, listener: PlayerEngineListener<T>): void;
3124
3262
  /**
3125
3263
  * @returns currently playing audio track in ISO 639-1 format ('cs', 'en' etc.) or null if not available
@@ -3203,7 +3341,7 @@ export declare interface PlayerEngineInterface {
3203
3341
  /**
3204
3342
  * @public
3205
3343
  */
3206
- export declare type PlayerEngineListener<T> = (value: T) => any;
3344
+ export declare type PlayerEngineListener<T> = (value: T) => void;
3207
3345
 
3208
3346
  /**
3209
3347
  * @public
@@ -3970,6 +4108,14 @@ export declare type PurchaseEndpointPayload = {
3970
4108
  };
3971
4109
  };
3972
4110
 
4111
+ /**
4112
+ * @public
4113
+ */
4114
+ export declare type PurchaseEventHandlers = {
4115
+ onPurchaseIntention?: (purchase: PurchasableMonetization) => void;
4116
+ onPurchaseFinished?: (purchase: Purchase) => void;
4117
+ };
4118
+
3973
4119
  /**
3974
4120
  * @public
3975
4121
  */
@@ -4032,6 +4178,20 @@ export declare enum PurchaseStatus {
4032
4178
  */
4033
4179
  export declare type PurchaseType = 'transaction' | 'subscription' | 'voucher';
4034
4180
 
4181
+ export declare type PushNotificationSchedulerRequest = {
4182
+ operation: SchedulerOperation.SCHEDULE;
4183
+ status: NotificationStatus;
4184
+ payload: SchedulePushNotificationPayload;
4185
+ } | {
4186
+ operation: SchedulerOperation.UNSCHEDULE;
4187
+ organizationId: string;
4188
+ contentId: string;
4189
+ } | {
4190
+ operation: SchedulerOperation.GET_STATUS;
4191
+ organizationId: string;
4192
+ contentId: string;
4193
+ };
4194
+
4035
4195
  /**
4036
4196
  * TODO more generic name, since we support stargaze payment gateway as well
4037
4197
  * @public
@@ -4198,6 +4358,8 @@ export declare interface QuizGameGroupStats {
4198
4358
 
4199
4359
  export declare enum QuizGameGroupType {
4200
4360
  HIGHLIGHTED_PLAYERS = "HIGHLIGHTED_PLAYERS",
4361
+ /** Participants playing in Offline mode */
4362
+ LOCAL_PLAYERS = "LOCAL_PLAYERS",
4201
4363
  ALL = "ALL",
4202
4364
  PARTY = "PARTY"
4203
4365
  }
@@ -4205,7 +4367,8 @@ export declare enum QuizGameGroupType {
4205
4367
  export declare enum QuizGameRole {
4206
4368
  OBS = "OBS",
4207
4369
  HOST = "HOST",
4208
- PLAYER = "PLAYER"
4370
+ PLAYER = "PLAYER",
4371
+ LOCAL_PLAYER = "LOCAL_PLAYER"
4209
4372
  }
4210
4373
 
4211
4374
  export declare enum QuizGameStatus {
@@ -4404,7 +4567,7 @@ export declare interface RenderConditionValue {
4404
4567
  subscriptionRefs?: any[];
4405
4568
  }
4406
4569
 
4407
- export declare const renderWebPlayer: (container: HTMLElement, props: WebPlayerProps) => void;
4570
+ export declare const renderWebPlayer: (container: HTMLElement, props: Omit<WebPlayerProps, 'onPlayerControllerCreated'>) => Promise<SimplifiedVideoController>;
4408
4571
 
4409
4572
  /**
4410
4573
  * Make all attributes in given type required, non-nullable and defined.
@@ -4450,6 +4613,7 @@ export declare interface RouterOverrides {
4450
4613
  urlHandle?: string;
4451
4614
  replace?: boolean;
4452
4615
  params?: string;
4616
+ callbackUrl?: string;
4453
4617
  }) => void;
4454
4618
  goToRegistrationPage: (options?: {
4455
4619
  origin?: RegistrationRedirect;
@@ -4763,6 +4927,38 @@ export declare interface ScheduleNotificationRequest {
4763
4927
  notificationPath: string;
4764
4928
  }
4765
4929
 
4930
+ export declare interface SchedulePushNotificationPayload {
4931
+ /**
4932
+ * To which content document will this notification relate to.
4933
+ */
4934
+ contentId: string;
4935
+ /**
4936
+ * Content document type.
4937
+ */
4938
+ contentType: 'video' | 'article';
4939
+ /**
4940
+ * To users of which organization should notifications be sent.
4941
+ */
4942
+ organizationId: string;
4943
+ /**
4944
+ * Contents of notification message that will be shown to users.
4945
+ */
4946
+ notification: {
4947
+ title: string;
4948
+ body?: string;
4949
+ imageUrl?: string;
4950
+ data?: {
4951
+ [key: string]: string;
4952
+ };
4953
+ };
4954
+ }
4955
+
4956
+ export declare enum SchedulerOperation {
4957
+ SCHEDULE = "SCHEDULE",
4958
+ UNSCHEDULE = "UNSCHEDULE",
4959
+ GET_STATUS = "GET_STATUS"
4960
+ }
4961
+
4766
4962
  /**
4767
4963
  * @public
4768
4964
  */
@@ -4788,6 +4984,7 @@ declare interface Screen_2 {
4788
4984
  fetchMoreRows: () => Promise<void>;
4789
4985
  hasNextPage: boolean;
4790
4986
  refetchIfNeeded: () => Promise<void>;
4987
+ allowOrganizationBanner?: boolean;
4791
4988
  }
4792
4989
  export { Screen_2 as Screen }
4793
4990
 
@@ -4946,6 +5143,27 @@ export declare interface SendMessageResponse {
4946
5143
  messageId?: string;
4947
5144
  }
4948
5145
 
5146
+ export declare interface SendPushNotificationsResponse {
5147
+ /**
5148
+ * Potential user count to send notifications to.
5149
+ * Will include organization users that have at least 1 device registered to receive notifications.
5150
+ */
5151
+ potentialUserCount: number;
5152
+ /**
5153
+ * Potential device count from users to send notifications to.
5154
+ * Resulting number is equals to {@link successNotificationCount} + {@link failureNotificationCount}
5155
+ */
5156
+ potentialDeviceCount: number;
5157
+ /**
5158
+ * Number of successfully sent notifications.
5159
+ */
5160
+ successNotificationCount: number;
5161
+ /**
5162
+ * Number of notifications that failed to send.
5163
+ */
5164
+ failureNotificationCount: number;
5165
+ }
5166
+
4949
5167
  export declare interface SendTivioTemplateEmailRequest {
4950
5168
  notificationId: string;
4951
5169
  organizationId: string;
@@ -4981,6 +5199,24 @@ export declare interface SeriesTileSpecificData {
4981
5199
  availableSeasons: AvailableSeason[];
4982
5200
  }
4983
5201
 
5202
+ /**
5203
+ * @public
5204
+ */
5205
+ export declare enum SessionType {
5206
+ /**
5207
+ * Umbrella streaming - viewer will be able to switch between different sources linked to the main source.
5208
+ */
5209
+ INTERACTIVE = "interactive",
5210
+ /**
5211
+ * Classic streaming - viewer will be able to watch a single LIVE source.
5212
+ */
5213
+ LIVE = "live",
5214
+ /**
5215
+ * On-demand streaming - viewer will be able to watch a single VOD source.
5216
+ */
5217
+ ON_DEMAND = "ondemand"
5218
+ }
5219
+
4984
5220
  export declare interface SetCustomClaimsRequest {
4985
5221
  organizationId: string;
4986
5222
  }
@@ -5037,6 +5273,110 @@ export declare const showGdprConsentPreferences: () => Promise<void>;
5037
5273
  */
5038
5274
  export declare type SignInProvider = 'google' | 'patreon' | 'apple';
5039
5275
 
5276
+ /**
5277
+ * Simplified VideoController interface for external rendering
5278
+ */
5279
+ export declare interface SimplifiedVideoController {
5280
+ /**
5281
+ * Resume playback from paused state
5282
+ */
5283
+ play(): void;
5284
+ /**
5285
+ * Pause the current playback
5286
+ */
5287
+ pause(): void;
5288
+ /**
5289
+ * Toggle between play and pause states
5290
+ */
5291
+ togglePause(): void;
5292
+ /**
5293
+ * Replay the current video from the beginning
5294
+ */
5295
+ replay(): Promise<void>;
5296
+ /**
5297
+ * Retry playback if it failed to start
5298
+ */
5299
+ retry(): void;
5300
+ /**
5301
+ * Seek to an absolute position in milliseconds
5302
+ * @param ms - Position in milliseconds from the start of the video
5303
+ */
5304
+ seekToAbsolutePosition(ms: number): void;
5305
+ /**
5306
+ * Seek relative to current position
5307
+ * @param ms - Number of milliseconds to seek (positive for forward, negative for backward)
5308
+ */
5309
+ seekBy(ms: number): void;
5310
+ /**
5311
+ * Seek to a percentage of the video duration
5312
+ * @param percentage - Percentage value between 0 and 100
5313
+ */
5314
+ seekToPercent(percentage: number): void;
5315
+ /**
5316
+ * Seek to the live position for live streams
5317
+ */
5318
+ seekToLive(): void;
5319
+ /**
5320
+ * Set the volume level
5321
+ * @param value - Volume level between 0 and 1
5322
+ */
5323
+ changeVolume(value: number): void;
5324
+ /**
5325
+ * Increase volume by 5%
5326
+ */
5327
+ volumeUp(): void;
5328
+ /**
5329
+ * Decrease volume by 5%
5330
+ */
5331
+ volumeDown(): void;
5332
+ /**
5333
+ * Mute the audio
5334
+ */
5335
+ mute(): void;
5336
+ /**
5337
+ * Unmute the audio
5338
+ */
5339
+ unmute(): void;
5340
+ /**
5341
+ * Toggle between muted and unmuted states
5342
+ */
5343
+ toggleMute(): void;
5344
+ /**
5345
+ * Currently playing source or null if no source is loaded
5346
+ */
5347
+ readonly currentSource: PlayerSource | null;
5348
+ /**
5349
+ * Add an event listener for player events
5350
+ * @param event - The event name to listen for (e.g., 'ended', 'timeupdate', 'statechange')
5351
+ * @param callback - Function to call when the event occurs
5352
+ */
5353
+ addEventListener<T>(event: string, callback: (value: T) => void): void;
5354
+ /**
5355
+ * Add an event listener for volume changes
5356
+ * @param event - Must be 'volumechange'
5357
+ * @param callback - Function called with volume state object
5358
+ */
5359
+ addEventListener(event: 'volumechange', callback: (value: {
5360
+ muted: boolean;
5361
+ volume: number;
5362
+ }) => void): void;
5363
+ /**
5364
+ * Remove an event listener
5365
+ * @param event - The event name to stop listening for
5366
+ * @param callback - The callback function to remove
5367
+ */
5368
+ removeEventListener<T>(event: string, callback: (value: T) => void): void;
5369
+ /**
5370
+ * Change the current source to a new one
5371
+ * @param source - The new source to load (can be a video path, channel path, or source parameters)
5372
+ */
5373
+ setSource(source: WebPlayerProps['source']): void;
5374
+ /**
5375
+ * Destroy the player and clean up all resources
5376
+ */
5377
+ destroy(): Promise<void>;
5378
+ }
5379
+
5040
5380
  export declare enum SocialNetworks {
5041
5381
  FACEBOOK = 0,
5042
5382
  INSTAGRAM = 1,
@@ -5137,6 +5477,19 @@ export declare type StartAndContinuePosition = {
5137
5477
  continueFromPosition?: number;
5138
5478
  };
5139
5479
 
5480
+ export declare type StartLiveStreamPayload = BaseWidgetControlPayload;
5481
+
5482
+ declare interface StartLiveStreamRequest {
5483
+ action: 'startLiveStream';
5484
+ payload: StartLiveStreamPayload;
5485
+ }
5486
+
5487
+ export declare interface StartLiveStreamResponse {
5488
+ liveStreamProcessPath: string;
5489
+ streamingStudioProcessPath: string;
5490
+ error?: string;
5491
+ }
5492
+
5140
5493
  /**
5141
5494
  * @public
5142
5495
  */
@@ -5259,8 +5612,8 @@ export declare interface Tag extends RowItem {
5259
5612
  detailBanner?: string;
5260
5613
  availableSeasons?: AvailableSeason[];
5261
5614
  isFavorite: boolean;
5262
- addToFavorites: () => void;
5263
- removeFromFavorites: () => void;
5615
+ addToFavorites: () => Promise<void>;
5616
+ removeFromFavorites: () => Promise<void>;
5264
5617
  cover: string;
5265
5618
  getApplicationName: () => string | undefined;
5266
5619
  seriesRef?: DocumentReference<any>;
@@ -5522,7 +5875,6 @@ export declare interface TivioComponents {
5522
5875
  }>;
5523
5876
  Provider: React_2.ComponentType<RemoteProviderProps>;
5524
5877
  WebPlayer: React_2.ComponentType<WebPlayerProps>;
5525
- Widget: React_2.ComponentType<TivioWidgetProps>;
5526
5878
  PlayerDataContextProvider: React_2.ComponentType<{
5527
5879
  id: string;
5528
5880
  }>;
@@ -5551,9 +5903,7 @@ export declare interface TivioComponents {
5551
5903
  WebTile: React_2.ComponentType<{
5552
5904
  item?: ItemInRow;
5553
5905
  } & TilePropsPartial>;
5554
- ChannelContext: React_2.Context<TvChannel | undefined>;
5555
5906
  ContentSortPicker: React_2.ComponentType<ContentSortPickerProps>;
5556
- WebProfileScreen: React_2.ComponentType<WebProfileScreenProps>;
5557
5907
  WebTivioProVideoScreen: React_2.ComponentType<WebTivioProVideoScreenProps>;
5558
5908
  RemoteController: React_2.ComponentType<RemoteControllerProps>;
5559
5909
  }
@@ -5579,14 +5929,24 @@ export declare interface TivioConfig {
5579
5929
  preferHttp?: boolean;
5580
5930
  };
5581
5931
  secret: string;
5932
+ /**
5933
+ * Language used when isLanguageSelectionEnabled is false | undefined or when not possible to load language from local storage or localization worker
5934
+ */
5582
5935
  language: LangCode;
5583
5936
  debug?: boolean;
5584
5937
  verbose?: boolean;
5585
5938
  firebaseApp?: any | null;
5586
- firebaseFactory?: (config: Object, appName?: string) => firebase_2.FirebaseApp;
5939
+ firebaseFactory?: (config: object, appName?: string) => firebase_2.FirebaseApp;
5587
5940
  authDomainOverride?: string;
5588
5941
  firestore?: any | null;
5589
5942
  currency: Currency;
5943
+ /**
5944
+ * A flag that indicates whether the language selection feature is enabled.
5945
+ * Language is then stored to local storage 'tivio-user-language'.
5946
+ * If nothing is stored in local storage, then language is set according to location
5947
+ * When set to `true`, users are allowed to choose their preferred language
5948
+ */
5949
+ isLanguageSelectionEnabled?: boolean;
5590
5950
  applicationId?: string;
5591
5951
  isTivioProApp?: boolean;
5592
5952
  lockApplicationHandle?: string;
@@ -5812,6 +6172,9 @@ export declare type TivioInternalProviders = {
5812
6172
  }>;
5813
6173
  MonetizationsSelectOverlayContextProvider: React_2.ComponentType;
5814
6174
  QerkoOverlayContextProvider: React_2.ComponentType;
6175
+ /**
6176
+ * @deprecated do not use, this provider will be removed in the future
6177
+ */
5815
6178
  PurchasesWithVideosContextProvider: React_2.ComponentType<{
5816
6179
  children?: React_2.ReactNode;
5817
6180
  }>;
@@ -5969,55 +6332,6 @@ export declare type TivioVodSource = SourceBase & StartAndContinuePosition & {
5969
6332
  videoPath: string;
5970
6333
  };
5971
6334
 
5972
- /**
5973
- * @public
5974
- */
5975
- export declare const TivioWidget: React_2.ForwardRefExoticComponent<Omit<TivioWidgetProps, "ref"> & React_2.RefAttributes<TivioWidgetRef>>;
5976
-
5977
- /**
5978
- * @public
5979
- */
5980
- export declare const TivioWidgetError: React_2.FC<TivioWidgetErrorProps>;
5981
-
5982
- declare type TivioWidgetErrorProps = {
5983
- error: string | null;
5984
- };
5985
-
5986
- /**
5987
- * @public
5988
- */
5989
- export declare const TivioWidgetLoader: React_2.FC;
5990
-
5991
- /**
5992
- * @public
5993
- */
5994
- export declare interface TivioWidgetProps {
5995
- id: string;
5996
- ref: React_2.MutableRefObject<TivioWidgetRef>;
5997
- onEnabled?: (enabled: boolean) => any;
5998
- onBlur?: (event: {
5999
- key: string;
6000
- width: number;
6001
- x: number;
6002
- }) => any;
6003
- }
6004
-
6005
- /**
6006
- * @public
6007
- */
6008
- export declare interface TivioWidgetRef {
6009
- focus: (args: {
6010
- x?: number;
6011
- }) => void;
6012
- handleKey: (key: string) => ({
6013
- handled: boolean;
6014
- x: number;
6015
- });
6016
- unfocus: () => ({
6017
- x: number;
6018
- });
6019
- }
6020
-
6021
6335
  export declare interface TokenInterface {
6022
6336
  token: string;
6023
6337
  expirationDate: Date;
@@ -6205,6 +6519,25 @@ export declare enum TvStreamType {
6205
6519
  */
6206
6520
  export declare const TvTivioProvider: React_2.FC<TivioProviderProps>;
6207
6521
 
6522
+ export declare type UpdateNotificationSettingsRequest = {
6523
+ tokenToAdd: string;
6524
+ platform: string;
6525
+ tokenToDelete?: string;
6526
+ validateToken?: never;
6527
+ } | {
6528
+ tokenToDelete: string;
6529
+ tokenToAdd?: never;
6530
+ platform?: never;
6531
+ validateToken?: never;
6532
+ } | {
6533
+ validateToken: string;
6534
+ tokenToAdd?: never;
6535
+ platform?: never;
6536
+ tokenToDelete?: never;
6537
+ };
6538
+
6539
+ export declare type UpdateNotificationSettingsResponse = Promise<boolean>;
6540
+
6208
6541
  export declare type UpsertCommentResponse = AddEditCommentResponse | DeleteCommentResponse;
6209
6542
 
6210
6543
  /**
@@ -6299,7 +6632,7 @@ export declare const useChannelSource: (tvChannelId: string) => {
6299
6632
  * but for live video with comments, we want to subscribe to conversation
6300
6633
  */
6301
6634
  export declare type UseComments = (options: UseMessagesOptions) => {
6302
- pagination: PaginationInterface<Comment>;
6635
+ pagination: PaginationInterface<unknown>;
6303
6636
  addComment: (options: AddMessageOptions) => Promise<UseMessagesAddEditMessageResponse>;
6304
6637
  editComment: (options: EditMessageOptions) => Promise<UseMessagesAddEditMessageResponse>;
6305
6638
  deleteComment: (commentId: string) => Promise<UseMessagesDeleteMessageResponse>;
@@ -6562,6 +6895,9 @@ export declare type User = {
6562
6895
  getAllExtendableSubscriptions: () => Promise<Purchase[]>;
6563
6896
  getRssValidToken: () => Promise<TokenInterface | undefined>;
6564
6897
  getRssUrl: () => Promise<GetUserRssUrlResponse>;
6898
+ getFavorites: (options?: GetUserProfileDataOptions) => Promise<FavoriteWithData[]>;
6899
+ getWatchPositions: (options?: GetUserProfileDataOptions) => Promise<WatchPositionWithData[]>;
6900
+ getWatchHistory: (options?: GetUserProfileDataOptions) => Promise<WatchPositionWithData[]>;
6565
6901
  invalidateAllTokens: (type: TokenType) => Promise<void>;
6566
6902
  isPartiallyRegistered: boolean;
6567
6903
  conversationStore: ConversationStore;
@@ -6593,6 +6929,16 @@ export declare enum UserGroup {
6593
6929
  PREMIUM = "premium"
6594
6930
  }
6595
6931
 
6932
+ export declare interface UserNotificationRegistrationToken {
6933
+ token: string;
6934
+ platform?: string;
6935
+ created: Timestamp;
6936
+ }
6937
+
6938
+ export declare interface UserNotificationSettings {
6939
+ registrationTokens?: UserNotificationRegistrationToken[];
6940
+ }
6941
+
6596
6942
  /**
6597
6943
  * @public
6598
6944
  */
@@ -6861,6 +7207,16 @@ export declare interface verifyCustomTokenProps {
6861
7207
  organizationPath: string;
6862
7208
  }
6863
7209
 
7210
+ declare interface VerifyJoinCodePayload extends BaseWidgetControlPayload {
7211
+ joinCode: string;
7212
+ shouldJoinPlayer?: boolean;
7213
+ }
7214
+
7215
+ export declare interface VerifyJoinCodeRequest {
7216
+ action: 'verifyJoinCode';
7217
+ payload: VerifyJoinCodePayload;
7218
+ }
7219
+
6864
7220
  /**
6865
7221
  * @public
6866
7222
  */
@@ -6917,8 +7273,8 @@ export declare interface Video extends RowItem, MonetizableItem, ReactableConten
6917
7273
  tasting: Video | null;
6918
7274
  watchPosition: number | null;
6919
7275
  isFavorite: boolean;
6920
- addToFavorites: () => void;
6921
- removeFromFavorites: () => void;
7276
+ addToFavorites: () => Promise<void>;
7277
+ removeFromFavorites: () => Promise<void>;
6922
7278
  availability: ContentAvailability | null;
6923
7279
  sourceLanguages: LangCode[];
6924
7280
  urlByLanguage: (lang: LangCode) => string | undefined;
@@ -6954,6 +7310,154 @@ export declare enum VideoContentType {
6954
7310
  SERIES = "SERIES"
6955
7311
  }
6956
7312
 
7313
+ /**
7314
+ * @public
7315
+ * VideoController provides control over video playback, seeking, volume, and event handling.
7316
+ */
7317
+ export declare interface VideoController {
7318
+ /** Unique identifier for this player instance */
7319
+ readonly playerId: string;
7320
+ /** Internal control queue for managing player operations */
7321
+ readonly controlQueue: unknown;
7322
+ /** Currently playing source or null if no source is loaded */
7323
+ readonly currentSource: PlayerSource | null;
7324
+ /**
7325
+ * Add an event listener for player events
7326
+ * @param event - The event name to listen for (e.g., 'ended', 'timeupdate', 'statechange')
7327
+ * @param callback - Function to call when the event occurs
7328
+ */
7329
+ addEventListener<T>(event: string, callback: (value: T) => void): void;
7330
+ addEventListener(event: 'volumechange', callback: (value: {
7331
+ muted: boolean;
7332
+ volume: number;
7333
+ }) => void): void;
7334
+ /**
7335
+ * Remove an event listener
7336
+ * @param event - The event name to stop listening for
7337
+ * @param callback - The callback function to remove
7338
+ */
7339
+ removeEventListener<T>(event: string, callback: (value: T) => void): void;
7340
+ /**
7341
+ * Change the current source to a new one
7342
+ * @param sourceData - The new source parameters
7343
+ * @param autoplay - Whether to start playing immediately (default: true)
7344
+ * @returns Promise that resolves to the new source or null if failed
7345
+ */
7346
+ changeSource(sourceData: SourceParams, autoplay?: boolean): Promise<PlayerSource | null>;
7347
+ /**
7348
+ * Load a new source and optionally start playing
7349
+ * @param sourceData - The source parameters to load
7350
+ * @param autoplay - Whether to start playing immediately
7351
+ */
7352
+ load(sourceData: SourceParams, autoplay: boolean): Promise<void>;
7353
+ /**
7354
+ * Toggle between play and pause states
7355
+ */
7356
+ togglePause(): void;
7357
+ /**
7358
+ * Pause the current playback
7359
+ */
7360
+ pause(): void;
7361
+ /**
7362
+ * Resume playback from paused state
7363
+ */
7364
+ unpause(): void;
7365
+ /**
7366
+ * Replay the current video from the beginning
7367
+ */
7368
+ replay(): Promise<void>;
7369
+ /**
7370
+ * Retry playback if it failed to start
7371
+ */
7372
+ retry(): void;
7373
+ /**
7374
+ * Stop playback and reset player state
7375
+ */
7376
+ close(): void;
7377
+ /**
7378
+ * Destroy the player and clean up all resources
7379
+ */
7380
+ destroy(): Promise<void>;
7381
+ /**
7382
+ * Seek to an absolute position in milliseconds
7383
+ * @param ms - Position in milliseconds from the start of the video
7384
+ */
7385
+ seekToAbsolutePosition(ms: number): void;
7386
+ /**
7387
+ * Seek relative to current position
7388
+ * @param ms - Number of milliseconds to seek (positive for forward, negative for backward)
7389
+ */
7390
+ seekBy(ms: number): void;
7391
+ /**
7392
+ * Seek to a percentage of the video duration
7393
+ * @param percentage - Percentage value between 0 and 100
7394
+ */
7395
+ seekToPercent(percentage: number): void;
7396
+ /**
7397
+ * @deprecated Use seekToPercent instead
7398
+ * Seek to a relative position as percentage of video duration
7399
+ * @param percentage - Percentage value between 0 and 100
7400
+ */
7401
+ seekToRelativePosition(percentage: number): void;
7402
+ /**
7403
+ * Seek to the live position for live streams
7404
+ */
7405
+ seekToLive(): void;
7406
+ /**
7407
+ * Internal method to seek to live position
7408
+ */
7409
+ seekToLiveInternal(): void;
7410
+ /**
7411
+ * Set the volume level
7412
+ * @param value - Volume level between 0 and 1
7413
+ */
7414
+ changeVolume(value: number): void;
7415
+ /**
7416
+ * Increase volume by 5%
7417
+ */
7418
+ volumeUp(): void;
7419
+ /**
7420
+ * Decrease volume by 5%
7421
+ */
7422
+ volumeDown(): void;
7423
+ /**
7424
+ * Mute the audio
7425
+ */
7426
+ mute(): void;
7427
+ /**
7428
+ * Unmute the audio
7429
+ */
7430
+ unmute(): void;
7431
+ /**
7432
+ * Toggle between muted and unmuted states
7433
+ */
7434
+ toggleMute(): void;
7435
+ /**
7436
+ * Enter fullscreen mode
7437
+ */
7438
+ goFullScreen(): Promise<void>;
7439
+ /**
7440
+ * @deprecated Use durationchange event instead
7441
+ * Set the duration of the current video in milliseconds
7442
+ * @param ms - Duration in milliseconds
7443
+ */
7444
+ setDurationMs(ms: number): void;
7445
+ /**
7446
+ * Get the duration of the current video in milliseconds
7447
+ * @returns Duration in milliseconds
7448
+ */
7449
+ getDurationMs(): number;
7450
+ /** Whether live seeking is enabled for the current source */
7451
+ readonly isLiveSeekingEnabled: boolean;
7452
+ /** Whether the current playback position is live */
7453
+ readonly isCurrentTimeLive: boolean;
7454
+ /**
7455
+ * Handle watermark element changes for security purposes
7456
+ * @param mutations - Array of DOM mutation records
7457
+ */
7458
+ onWatermarkElementChange(mutations: MutationRecord[]): void;
7459
+ }
7460
+
6957
7461
  declare type VideoDetailResponsiveField = OrganizationResponsiveSetting<{
6958
7462
  modalView?: boolean;
6959
7463
  showDateOfPublicationForRelatedVideos?: boolean;
@@ -7294,6 +7798,21 @@ export declare interface WarningConfirmationOverlayPayload extends ConfirmationO
7294
7798
  subscriptionExpirationText?: string;
7295
7799
  }
7296
7800
 
7801
+ /**
7802
+ * @public
7803
+ */
7804
+ export declare interface WatchPositionWithData extends Omit<UserWatchPositionField, 'videoRef' | 'tagRef'> {
7805
+ /**
7806
+ * Video that given watch position is related to.
7807
+ */
7808
+ video: Video;
7809
+ /**
7810
+ * If user watches episode of series, we have to save series ref as well.
7811
+ * Same for {@link episodeNumber} and {@link seasonNumber}.
7812
+ */
7813
+ tag?: Tag;
7814
+ }
7815
+
7297
7816
  /**
7298
7817
  * @public
7299
7818
  */
@@ -7511,6 +8030,10 @@ export declare interface WebConfig {
7511
8030
  [key: string]: string;
7512
8031
  };
7513
8032
  };
8033
+ /**
8034
+ * Map for all handlers
8035
+ */
8036
+ handlers?: PurchaseEventHandlers;
7514
8037
  }
7515
8038
 
7516
8039
  /**
@@ -7576,10 +8099,7 @@ export declare interface WebPlayerProps {
7576
8099
  */
7577
8100
  enableKeyboardShortcuts?: boolean;
7578
8101
  onProgress?: (event: React_2.ChangeEvent<HTMLVideoElement>) => void;
7579
- /**
7580
- * @deprecated this callback is never called. Will be removed in @tivio/sdk-react version 4
7581
- */
7582
- onPlayerControllerCreated?: (playerController: any) => void;
8102
+ onPlayerControllerCreated?: (playerController: VideoController) => void;
7583
8103
  /**
7584
8104
  * If true, saving of watch position won't be performed.
7585
8105
  */
@@ -7702,6 +8222,16 @@ export declare type Widget = {
7702
8222
  lastVideo: Video | null;
7703
8223
  };
7704
8224
 
8225
+ export declare type WidgetControlRequest = StartLiveStreamRequest | ChangeWidgetStateRequest_2 | GenerateWidgetJoinCodeRequest | VerifyJoinCodeRequest;
8226
+
8227
+ export declare type WidgetControlResponse<T extends WidgetControlRequest['action']> = T extends 'startLiveStream' ? StartLiveStreamResponse : T extends 'changeState' ? ChangeStateResponse : T extends 'generateWidgetJoinCode' ? GenerateWidgetJoinCodeResponse : T extends 'verifyJoinCode' ? boolean : never;
8228
+
8229
+ export declare interface WidgetSecret {
8230
+ code: string;
8231
+ type: 'JWT' | 'alphanumeric';
8232
+ expired?: Date;
8233
+ }
8234
+
7705
8235
  /**
7706
8236
  * @public
7707
8237
  */