@tivio/sdk-react 9.2.0-alpha.3 → 9.2.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.
@@ -659,6 +659,17 @@ export declare interface ButtonOptions {
659
659
  color?: string;
660
660
  padding?: string;
661
661
  maxWidth?: string;
662
+ primary?: ButtonVariantOptions;
663
+ secondary?: ButtonVariantOptions;
664
+ transparent?: ButtonVariantOptions;
665
+ disabled?: ButtonVariantOptions;
666
+ }
667
+
668
+ /**
669
+ * @internal
670
+ */
671
+ export declare interface ButtonVariantOptions {
672
+ border?: string;
662
673
  }
663
674
 
664
675
  /**
@@ -1042,6 +1053,18 @@ export declare interface ConversionsTargetItem {
1042
1053
 
1043
1054
  export declare type CountdownScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.COUNTDOWN>;
1044
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
+
1045
1068
  /**
1046
1069
  * @public
1047
1070
  * @TODO move somewhere else
@@ -1062,11 +1085,11 @@ export declare const createPubSub: () => PubSub;
1062
1085
  * Fetch & load CommonJS remote module.
1063
1086
  * @public
1064
1087
  */
1065
- 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>;
1066
1089
 
1067
1090
  export declare const createTivio: () => (conf: SdkReactConfig) => Promise<RemoteBundleState>;
1068
1091
 
1069
- export declare const createUseRemoteBundle: () => (sdkReactConfig: SdkReactConfig, checkBundleCharCount?: boolean) => RemoteBundleState;
1092
+ export declare const createUseRemoteBundle: () => (sdkReactConfig: SdkReactConfig, checkBundleCharCount?: boolean, skipCache?: boolean) => RemoteBundleState;
1070
1093
 
1071
1094
  export declare interface CreateUserPayload {
1072
1095
  displayName?: string;
@@ -1080,10 +1103,12 @@ export declare interface CreateUserPayload {
1080
1103
  isAnonymous?: boolean;
1081
1104
  }
1082
1105
 
1106
+ export declare type CreateUserProfileRequest = Omit<UserProfile, 'id'>;
1107
+
1083
1108
  /**
1084
1109
  * @public
1085
1110
  */
1086
- export declare type CreateUserWithEmailAndPassword = (email: string, password: string, username?: string, phoneNumber?: string, referralToken?: string) => Promise<string | null>;
1111
+ export declare type CreateUserWithEmailAndPassword = (email: string, password: string, username: string, phoneNumber?: string, referralToken?: string) => Promise<string | null>;
1087
1112
 
1088
1113
  export declare interface CreatorsWithVoucherSubscriptions {
1089
1114
  id: string;
@@ -1140,7 +1165,6 @@ export declare enum CustomerId {
1140
1165
  GRAPE = "GRAPE",
1141
1166
  HODINA_DEJEPICHU = "HODINA_DEJEPICHU",
1142
1167
  INVESTICNI_PRUVODCE = "INVESTICNI_PRUVODCE",
1143
- INVESTOREES = "INVESTOREES",
1144
1168
  JOJ = "JOJ",
1145
1169
  KLUCI_Z_PRAHY = "KLUCI_Z_PRAHY",
1146
1170
  MALL = "MALL",
@@ -1185,7 +1209,8 @@ export declare enum CustomerId {
1185
1209
  BEAT_SEXISM = "BEAT_SEXISM",
1186
1210
  KAROL_A_KVIDO = "KAROL_A_KVIDO",
1187
1211
  UZ_BUDU = "UZ_BUDU",
1188
- PRIMA = "PRIMA"
1212
+ PRIMA = "PRIMA",
1213
+ NORA_FRIDRICHOVA = "NORA_FRIDRICHOVA"
1189
1214
  }
1190
1215
 
1191
1216
  /**
@@ -1249,6 +1274,7 @@ export declare interface Customizations {
1249
1274
  playVideoButton?: {
1250
1275
  backgroundColor?: string;
1251
1276
  color?: string;
1277
+ border?: string;
1252
1278
  };
1253
1279
  logo?: {
1254
1280
  height: string;
@@ -1285,10 +1311,13 @@ export declare interface Customizations {
1285
1311
  color?: string;
1286
1312
  backgroundGradient?: string;
1287
1313
  iconColor?: string;
1314
+ roundedMenuColor?: string;
1315
+ roundedMenuHoverColor?: string;
1288
1316
  };
1289
1317
  CenteredMenu?: {
1290
1318
  backgroundColor: string;
1291
1319
  menuLinkColor: string;
1320
+ border?: string;
1292
1321
  };
1293
1322
  Footer: {
1294
1323
  backgroundColor: string;
@@ -1392,6 +1421,12 @@ export declare interface Customizations {
1392
1421
  background: string;
1393
1422
  backgroundMobile: string;
1394
1423
  };
1424
+ Feed?: {
1425
+ backgroundColor?: string;
1426
+ Description?: {
1427
+ color?: string;
1428
+ };
1429
+ };
1395
1430
  }
1396
1431
 
1397
1432
  export declare interface CustomScript {
@@ -1541,6 +1576,8 @@ export declare enum DrmProvider {
1541
1576
  * Original oktagon stream provider.
1542
1577
  *
1543
1578
  * https://streamonline.pl
1579
+ *
1580
+ * @deprecated oktagon no longer uses this drm provider.
1544
1581
  */
1545
1582
  STREAMONLINE = "streamonline"
1546
1583
  }
@@ -1684,8 +1721,8 @@ export declare type EmbedScreenPostMessageFn = <T extends EmbedScreenPostMessage
1684
1721
  */
1685
1722
  export declare interface EmitterInterface {
1686
1723
  isSupported: (even: string) => boolean;
1687
- addListener: <T = any>(event: string, cb: (value: T) => Empty_2) => void;
1688
- removeListener: <T = any>(event: string, cb: (value: T) => Empty_2) => void;
1724
+ addListener: <T = unknown>(event: string, cb: (value: T) => Empty_2) => void;
1725
+ removeListener: <T = unknown>(event: string, cb: (value: T) => Empty_2) => void;
1689
1726
  }
1690
1727
 
1691
1728
  /**
@@ -1924,6 +1961,10 @@ export declare interface GetSourceUrlRequest {
1924
1961
  * Start time in ms, for live streams. Will return manifest with desired start.
1925
1962
  */
1926
1963
  startTimeMs?: number;
1964
+ /**
1965
+ * Parameters related to ads.
1966
+ */
1967
+ adParams?: Record<string, string | number | undefined>;
1927
1968
  }
1928
1969
 
1929
1970
  export declare interface GetSourceUrlResponse {
@@ -3383,9 +3424,8 @@ export declare interface PlayerEngineInterface {
3383
3424
  stop(): Promise<void>;
3384
3425
  addEventListener<T>(event: PlayerEngineEvent, callback: PlayerEngineListener<T>): void;
3385
3426
  addEventListener(event: 'statechange', callback: PlayerEngineListener<PlayerState>): void;
3386
- addEventListener(event: 'bufferingchange', callback: PlayerEngineListener<boolean>): void;
3427
+ addEventListener(event: 'bufferingchange' | 'togglefullscreen', callback: PlayerEngineListener<boolean>): void;
3387
3428
  addEventListener(event: 'bufferedinfochange', callback: PlayerEngineListener<BufferPercentChunk[]>): void;
3388
- addEventListener(event: 'togglefullscreen', callback: PlayerEngineListener<boolean>): void;
3389
3429
  removeEventListener<T>(event: PlayerEngineEvent, listener: PlayerEngineListener<T>): void;
3390
3430
  /**
3391
3431
  * @returns currently playing audio track in ISO 639-1 format ('cs', 'en' etc.) or null if not available
@@ -3469,7 +3509,7 @@ export declare interface PlayerEngineInterface {
3469
3509
  /**
3470
3510
  * @public
3471
3511
  */
3472
- export declare type PlayerEngineListener<T> = (value: T) => any;
3512
+ export declare type PlayerEngineListener<T> = (value: T) => void;
3473
3513
 
3474
3514
  /**
3475
3515
  * @public
@@ -4236,6 +4276,14 @@ export declare type PurchaseEndpointPayload = {
4236
4276
  };
4237
4277
  };
4238
4278
 
4279
+ /**
4280
+ * @public
4281
+ */
4282
+ export declare type PurchaseEventHandlers = {
4283
+ onPurchaseIntention?: (purchase: PurchasableMonetization) => void;
4284
+ onPurchaseFinished?: (purchase: Purchase) => void;
4285
+ };
4286
+
4239
4287
  /**
4240
4288
  * @public
4241
4289
  */
@@ -4670,7 +4718,7 @@ export declare interface RenderConditionValue {
4670
4718
  subscriptionRefs?: any[];
4671
4719
  }
4672
4720
 
4673
- export declare const renderWebPlayer: (container: HTMLElement, props: WebPlayerProps) => void;
4721
+ export declare const renderWebPlayer: (container: HTMLElement, props: Omit<WebPlayerProps, 'onPlayerControllerCreated'>) => Promise<SimplifiedVideoController>;
4674
4722
 
4675
4723
  /**
4676
4724
  * Make all attributes in given type required, non-nullable and defined.
@@ -5063,6 +5111,7 @@ declare interface Screen_2 {
5063
5111
  fetchMoreRows: () => Promise<void>;
5064
5112
  hasNextPage: boolean;
5065
5113
  refetchIfNeeded: () => Promise<void>;
5114
+ allowOrganizationBanner?: boolean;
5066
5115
  }
5067
5116
  export { Screen_2 as Screen }
5068
5117
 
@@ -5312,6 +5361,110 @@ export declare const showGdprConsentPreferences: () => Promise<void>;
5312
5361
  */
5313
5362
  export declare type SignInProvider = 'google' | 'patreon' | 'apple';
5314
5363
 
5364
+ /**
5365
+ * Simplified VideoController interface for external rendering
5366
+ */
5367
+ export declare interface SimplifiedVideoController {
5368
+ /**
5369
+ * Resume playback from paused state
5370
+ */
5371
+ play(): void;
5372
+ /**
5373
+ * Pause the current playback
5374
+ */
5375
+ pause(): void;
5376
+ /**
5377
+ * Toggle between play and pause states
5378
+ */
5379
+ togglePause(): void;
5380
+ /**
5381
+ * Replay the current video from the beginning
5382
+ */
5383
+ replay(): Promise<void>;
5384
+ /**
5385
+ * Retry playback if it failed to start
5386
+ */
5387
+ retry(): void;
5388
+ /**
5389
+ * Seek to an absolute position in milliseconds
5390
+ * @param ms - Position in milliseconds from the start of the video
5391
+ */
5392
+ seekToAbsolutePosition(ms: number): void;
5393
+ /**
5394
+ * Seek relative to current position
5395
+ * @param ms - Number of milliseconds to seek (positive for forward, negative for backward)
5396
+ */
5397
+ seekBy(ms: number): void;
5398
+ /**
5399
+ * Seek to a percentage of the video duration
5400
+ * @param percentage - Percentage value between 0 and 100
5401
+ */
5402
+ seekToPercent(percentage: number): void;
5403
+ /**
5404
+ * Seek to the live position for live streams
5405
+ */
5406
+ seekToLive(): void;
5407
+ /**
5408
+ * Set the volume level
5409
+ * @param value - Volume level between 0 and 1
5410
+ */
5411
+ changeVolume(value: number): void;
5412
+ /**
5413
+ * Increase volume by 5%
5414
+ */
5415
+ volumeUp(): void;
5416
+ /**
5417
+ * Decrease volume by 5%
5418
+ */
5419
+ volumeDown(): void;
5420
+ /**
5421
+ * Mute the audio
5422
+ */
5423
+ mute(): void;
5424
+ /**
5425
+ * Unmute the audio
5426
+ */
5427
+ unmute(): void;
5428
+ /**
5429
+ * Toggle between muted and unmuted states
5430
+ */
5431
+ toggleMute(): void;
5432
+ /**
5433
+ * Currently playing source or null if no source is loaded
5434
+ */
5435
+ readonly currentSource: PlayerSource | null;
5436
+ /**
5437
+ * Add an event listener for player events
5438
+ * @param event - The event name to listen for (e.g., 'ended', 'timeupdate', 'statechange')
5439
+ * @param callback - Function to call when the event occurs
5440
+ */
5441
+ addEventListener<T>(event: string, callback: (value: T) => void): void;
5442
+ /**
5443
+ * Add an event listener for volume changes
5444
+ * @param event - Must be 'volumechange'
5445
+ * @param callback - Function called with volume state object
5446
+ */
5447
+ addEventListener(event: 'volumechange', callback: (value: {
5448
+ muted: boolean;
5449
+ volume: number;
5450
+ }) => void): void;
5451
+ /**
5452
+ * Remove an event listener
5453
+ * @param event - The event name to stop listening for
5454
+ * @param callback - The callback function to remove
5455
+ */
5456
+ removeEventListener<T>(event: string, callback: (value: T) => void): void;
5457
+ /**
5458
+ * Change the current source to a new one
5459
+ * @param source - The new source to load (can be a video path, channel path, or source parameters)
5460
+ */
5461
+ setSource(source: WebPlayerProps['source']): void;
5462
+ /**
5463
+ * Destroy the player and clean up all resources
5464
+ */
5465
+ destroy(): Promise<void>;
5466
+ }
5467
+
5315
5468
  export declare enum SocialNetworks {
5316
5469
  FACEBOOK = 0,
5317
5470
  INSTAGRAM = 1,
@@ -5836,20 +5989,27 @@ export declare type TivioAnalytics = {
5836
5989
  */
5837
5990
  export declare interface TivioAuth {
5838
5991
  /**
5992
+ * Create and sign up new user with given email and password.
5839
5993
  * @param email
5840
5994
  * @param password
5995
+ * @returns {string} - uid of newly created and signed-up user
5841
5996
  */
5842
5997
  createUserWithEmailAndPassword: CreateUserWithEmailAndPassword;
5843
5998
  /**
5844
- * Sign in the user and starts listening on his purchases
5999
+ * Sign in the user with given email and password and start listening on their purchases.
5845
6000
  * @param email
5846
6001
  * @param password
6002
+ * @returns {string} - uid of signed-in user.
5847
6003
  */
5848
6004
  signInWithEmailAndPassword: (email: string, password: string) => Promise<string | null>;
5849
6005
  signInWithCustomToken: (token: string) => Promise<string | null>;
6006
+ /**
6007
+ * Signs out currently signed-in user.
6008
+ */
5850
6009
  signOut: () => Promise<void>;
5851
6010
  /**
5852
- * Used for reset forgotten password by user
6011
+ * Resets password for given user email.
6012
+ * @param email
5853
6013
  */
5854
6014
  resetPassword: (email: string) => Promise<void>;
5855
6015
  }
@@ -5876,7 +6036,6 @@ export declare interface TivioComponents {
5876
6036
  }>;
5877
6037
  Provider: React_2.ComponentType<RemoteProviderProps>;
5878
6038
  WebPlayer: React_2.ComponentType<WebPlayerProps>;
5879
- Widget: React_2.ComponentType<TivioWidgetProps>;
5880
6039
  PlayerDataContextProvider: React_2.ComponentType<{
5881
6040
  id: string;
5882
6041
  }>;
@@ -5905,9 +6064,7 @@ export declare interface TivioComponents {
5905
6064
  WebTile: React_2.ComponentType<{
5906
6065
  item?: ItemInRow;
5907
6066
  } & TilePropsPartial>;
5908
- ChannelContext: React_2.Context<TvChannel | undefined>;
5909
6067
  ContentSortPicker: React_2.ComponentType<ContentSortPickerProps>;
5910
- WebProfileScreen: React_2.ComponentType<WebProfileScreenProps>;
5911
6068
  WebTivioProVideoScreen: React_2.ComponentType<WebTivioProVideoScreenProps>;
5912
6069
  RemoteController: React_2.ComponentType<RemoteControllerProps>;
5913
6070
  }
@@ -5933,14 +6090,24 @@ export declare interface TivioConfig {
5933
6090
  preferHttp?: boolean;
5934
6091
  };
5935
6092
  secret: string;
6093
+ /**
6094
+ * Language used when isLanguageSelectionEnabled is false | undefined or when not possible to load language from local storage or localization worker
6095
+ */
5936
6096
  language: LangCode;
5937
6097
  debug?: boolean;
5938
6098
  verbose?: boolean;
5939
6099
  firebaseApp?: any | null;
5940
- firebaseFactory?: (config: Object, appName?: string) => firebase_2.FirebaseApp;
6100
+ firebaseFactory?: (config: object, appName?: string) => firebase_2.FirebaseApp;
5941
6101
  authDomainOverride?: string;
5942
6102
  firestore?: any | null;
5943
6103
  currency: Currency;
6104
+ /**
6105
+ * A flag that indicates whether the language selection feature is enabled.
6106
+ * Language is then stored to local storage 'tivio-user-language'.
6107
+ * If nothing is stored in local storage, then language is set according to location
6108
+ * When set to `true`, users are allowed to choose their preferred language
6109
+ */
6110
+ isLanguageSelectionEnabled?: boolean;
5944
6111
  applicationId?: string;
5945
6112
  isTivioProApp?: boolean;
5946
6113
  lockApplicationHandle?: string;
@@ -5992,13 +6159,13 @@ export declare type TivioGetters = {
5992
6159
  /**
5993
6160
  * Get video by its id.
5994
6161
  * @param videoId - video id
5995
- * @returns {Promise<Video | null>} video or null if video does not exists
6162
+ * @returns {Promise<Video | null>} video or null if video does not exist
5996
6163
  */
5997
6164
  getVideoById: (videoId: string) => Promise<Video | null>;
5998
6165
  /**
5999
6166
  * Get screen by its id.
6000
6167
  * @param screenId - screen id
6001
- * @returns {Promise<Screen | null>} screen or null if screen does not exists
6168
+ * @returns {Promise<Screen | null>} screen or null if screen does not exist
6002
6169
  */
6003
6170
  getScreenById: (screenId: string, cb?: (error: Error | null, data: Screen_2 | null, disposer?: Disposer_2) => void) => Promise<Screen_2 | null>;
6004
6171
  /**
@@ -6006,6 +6173,11 @@ export declare type TivioGetters = {
6006
6173
  * @returns PlayerCapability[]
6007
6174
  */
6008
6175
  getPlayerCapabilities: () => PlayerCapability[];
6176
+ /**
6177
+ * Get currently logged-in user. If no user is logged in, returns `null`.
6178
+ * @returns User
6179
+ */
6180
+ getUser: () => User | null;
6009
6181
  };
6010
6182
 
6011
6183
  /**
@@ -6161,6 +6333,9 @@ export declare type TivioInternalProviders = {
6161
6333
  }>;
6162
6334
  MonetizationsSelectOverlayContextProvider: React_2.ComponentType;
6163
6335
  QerkoOverlayContextProvider: React_2.ComponentType;
6336
+ /**
6337
+ * @deprecated do not use, this provider will be removed in the future
6338
+ */
6164
6339
  PurchasesWithVideosContextProvider: React_2.ComponentType<{
6165
6340
  children?: React_2.ReactNode;
6166
6341
  }>;
@@ -6209,7 +6384,7 @@ export declare type TivioJsBundleExposedApi = {
6209
6384
  getTagById: (tagId: string) => Promise<Tag | null>;
6210
6385
  createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
6211
6386
  destroy: () => Promise<void>;
6212
- } & Pick<TivioGetters, 'getVideoById' | 'getScreenById' | 'organization'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow' | 'subscribeToRowsInScreen'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
6387
+ } & Pick<TivioGetters, 'getVideoById' | 'getScreenById' | 'organization' | 'getUser'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow' | 'subscribeToRowsInScreen'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword' | 'resetPassword' | 'signOut'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
6213
6388
 
6214
6389
  /**
6215
6390
  * @public
@@ -6326,55 +6501,6 @@ export declare type TivioVodSource = SourceBase & StartAndContinuePosition & {
6326
6501
  videoPath: string;
6327
6502
  };
6328
6503
 
6329
- /**
6330
- * @public
6331
- */
6332
- export declare const TivioWidget: React_2.ForwardRefExoticComponent<Omit<TivioWidgetProps, "ref"> & React_2.RefAttributes<TivioWidgetRef>>;
6333
-
6334
- /**
6335
- * @public
6336
- */
6337
- export declare const TivioWidgetError: React_2.FC<TivioWidgetErrorProps>;
6338
-
6339
- declare type TivioWidgetErrorProps = {
6340
- error: string | null;
6341
- };
6342
-
6343
- /**
6344
- * @public
6345
- */
6346
- export declare const TivioWidgetLoader: React_2.FC;
6347
-
6348
- /**
6349
- * @public
6350
- */
6351
- export declare interface TivioWidgetProps {
6352
- id: string;
6353
- ref: React_2.MutableRefObject<TivioWidgetRef>;
6354
- onEnabled?: (enabled: boolean) => any;
6355
- onBlur?: (event: {
6356
- key: string;
6357
- width: number;
6358
- x: number;
6359
- }) => any;
6360
- }
6361
-
6362
- /**
6363
- * @public
6364
- */
6365
- export declare interface TivioWidgetRef {
6366
- focus: (args: {
6367
- x?: number;
6368
- }) => void;
6369
- handleKey: (key: string) => ({
6370
- handled: boolean;
6371
- x: number;
6372
- });
6373
- unfocus: () => ({
6374
- x: number;
6375
- });
6376
- }
6377
-
6378
6504
  export declare interface TokenInterface {
6379
6505
  token: string;
6380
6506
  expirationDate: Date;
@@ -6851,18 +6977,45 @@ export declare type User = {
6851
6977
  isPurchasesInitialized: boolean;
6852
6978
  isSignedIn: boolean;
6853
6979
  isReady: boolean;
6980
+ /**
6981
+ * Email of this user.
6982
+ */
6854
6983
  email?: string;
6855
6984
  type?: UserType;
6856
6985
  photoURL: string | null;
6986
+ /**
6987
+ * Name of this user - typically first and last name combined, or any other nickname chosen by user.
6988
+ */
6857
6989
  name?: string;
6858
6990
  /**
6859
6991
  * Authentication id differs from {@link id}.
6860
6992
  */
6861
6993
  authUserId?: string;
6994
+ /**
6995
+ * List of content (e.g. videos / series) that user marked as their favorite.
6996
+ * Changes based on currently {@link activeUserProfileId}
6997
+ */
6862
6998
  favorites: any[];
6999
+ /**
7000
+ * List of content (e.g. videos / series) that user watched recently with precise time position where they last left watching.
7001
+ * Number of entries in the list is limited by constant number (i.e. older entries are deleted when limit is reached).
7002
+ * In some cases entries are actively removed even if they are new, for example when user watched video to the end.
7003
+ * Changes based on currently {@link activeUserProfileId}.
7004
+ */
6863
7005
  watchedPositions: any[];
7006
+ /**
7007
+ * Similar to {@link watchedPositions}, but has higher limit for number of entries,
7008
+ * and they never actively deleted (e.g. when user watched video to the end)
7009
+ * Changes based on currently {@link activeUserProfileId}.
7010
+ */
6864
7011
  watchHistory: any[];
6865
- profiles: any[];
7012
+ /**
7013
+ * List of profiles for this user.
7014
+ */
7015
+ profiles: UserProfile[];
7016
+ /**
7017
+ * Currently active user profile id.
7018
+ */
6866
7019
  activeUserProfileId: string | null;
6867
7020
  patreon?: PatreonUserAuth;
6868
7021
  subscriptionIdsToShow: string[] | null;
@@ -6870,9 +7023,22 @@ export declare type User = {
6870
7023
  isAnonymous: boolean;
6871
7024
  isDiscordConnected: boolean;
6872
7025
  disconnectDiscord: () => Promise<void>;
6873
- createUserProfile: (request: any) => Promise<void>;
7026
+ /**
7027
+ * Create new profile for this user.
7028
+ * @param request
7029
+ */
7030
+ createUserProfile: (request: CreateUserProfileRequest) => Promise<void>;
7031
+ /**
7032
+ * Delete given profile from this user.
7033
+ * @param profileId
7034
+ */
6874
7035
  deleteUserProfile: (profileId: string) => Promise<void>;
6875
- setActiveUserProfileId: (id: string) => void;
7036
+ /**
7037
+ * Activate given profile for this user.
7038
+ * After activation {@link favorites}, {@link watchedPositions} and {@link watchHistory} of given profile will be used.
7039
+ * @param profileId
7040
+ */
7041
+ setActiveUserProfileId: (profileId: string) => void;
6876
7042
  getFollowedOrganizations: () => Promise<Array<FollowedOrganizationData | undefined>>;
6877
7043
  sendFinalizeRegistrationEmail: (email: string) => Promise<void>;
6878
7044
  isUserAlreadyRegisteredByTenant: (email: string) => Promise<boolean>;
@@ -7271,6 +7437,154 @@ export declare enum VideoContentType {
7271
7437
  SERIES = "SERIES"
7272
7438
  }
7273
7439
 
7440
+ /**
7441
+ * @public
7442
+ * VideoController provides control over video playback, seeking, volume, and event handling.
7443
+ */
7444
+ export declare interface VideoController {
7445
+ /** Unique identifier for this player instance */
7446
+ readonly playerId: string;
7447
+ /** Internal control queue for managing player operations */
7448
+ readonly controlQueue: unknown;
7449
+ /** Currently playing source or null if no source is loaded */
7450
+ readonly currentSource: PlayerSource | null;
7451
+ /**
7452
+ * Add an event listener for player events
7453
+ * @param event - The event name to listen for (e.g., 'ended', 'timeupdate', 'statechange')
7454
+ * @param callback - Function to call when the event occurs
7455
+ */
7456
+ addEventListener<T>(event: string, callback: (value: T) => void): void;
7457
+ addEventListener(event: 'volumechange', callback: (value: {
7458
+ muted: boolean;
7459
+ volume: number;
7460
+ }) => void): void;
7461
+ /**
7462
+ * Remove an event listener
7463
+ * @param event - The event name to stop listening for
7464
+ * @param callback - The callback function to remove
7465
+ */
7466
+ removeEventListener<T>(event: string, callback: (value: T) => void): void;
7467
+ /**
7468
+ * Change the current source to a new one
7469
+ * @param sourceData - The new source parameters
7470
+ * @param autoplay - Whether to start playing immediately (default: true)
7471
+ * @returns Promise that resolves to the new source or null if failed
7472
+ */
7473
+ changeSource(sourceData: SourceParams, autoplay?: boolean): Promise<PlayerSource | null>;
7474
+ /**
7475
+ * Load a new source and optionally start playing
7476
+ * @param sourceData - The source parameters to load
7477
+ * @param autoplay - Whether to start playing immediately
7478
+ */
7479
+ load(sourceData: SourceParams, autoplay: boolean): Promise<void>;
7480
+ /**
7481
+ * Toggle between play and pause states
7482
+ */
7483
+ togglePause(): void;
7484
+ /**
7485
+ * Pause the current playback
7486
+ */
7487
+ pause(): void;
7488
+ /**
7489
+ * Resume playback from paused state
7490
+ */
7491
+ unpause(): void;
7492
+ /**
7493
+ * Replay the current video from the beginning
7494
+ */
7495
+ replay(): Promise<void>;
7496
+ /**
7497
+ * Retry playback if it failed to start
7498
+ */
7499
+ retry(): void;
7500
+ /**
7501
+ * Stop playback and reset player state
7502
+ */
7503
+ close(): void;
7504
+ /**
7505
+ * Destroy the player and clean up all resources
7506
+ */
7507
+ destroy(): Promise<void>;
7508
+ /**
7509
+ * Seek to an absolute position in milliseconds
7510
+ * @param ms - Position in milliseconds from the start of the video
7511
+ */
7512
+ seekToAbsolutePosition(ms: number): void;
7513
+ /**
7514
+ * Seek relative to current position
7515
+ * @param ms - Number of milliseconds to seek (positive for forward, negative for backward)
7516
+ */
7517
+ seekBy(ms: number): void;
7518
+ /**
7519
+ * Seek to a percentage of the video duration
7520
+ * @param percentage - Percentage value between 0 and 100
7521
+ */
7522
+ seekToPercent(percentage: number): void;
7523
+ /**
7524
+ * @deprecated Use seekToPercent instead
7525
+ * Seek to a relative position as percentage of video duration
7526
+ * @param percentage - Percentage value between 0 and 100
7527
+ */
7528
+ seekToRelativePosition(percentage: number): void;
7529
+ /**
7530
+ * Seek to the live position for live streams
7531
+ */
7532
+ seekToLive(): void;
7533
+ /**
7534
+ * Internal method to seek to live position
7535
+ */
7536
+ seekToLiveInternal(): void;
7537
+ /**
7538
+ * Set the volume level
7539
+ * @param value - Volume level between 0 and 1
7540
+ */
7541
+ changeVolume(value: number): void;
7542
+ /**
7543
+ * Increase volume by 5%
7544
+ */
7545
+ volumeUp(): void;
7546
+ /**
7547
+ * Decrease volume by 5%
7548
+ */
7549
+ volumeDown(): void;
7550
+ /**
7551
+ * Mute the audio
7552
+ */
7553
+ mute(): void;
7554
+ /**
7555
+ * Unmute the audio
7556
+ */
7557
+ unmute(): void;
7558
+ /**
7559
+ * Toggle between muted and unmuted states
7560
+ */
7561
+ toggleMute(): void;
7562
+ /**
7563
+ * Enter fullscreen mode
7564
+ */
7565
+ goFullScreen(): Promise<void>;
7566
+ /**
7567
+ * @deprecated Use durationchange event instead
7568
+ * Set the duration of the current video in milliseconds
7569
+ * @param ms - Duration in milliseconds
7570
+ */
7571
+ setDurationMs(ms: number): void;
7572
+ /**
7573
+ * Get the duration of the current video in milliseconds
7574
+ * @returns Duration in milliseconds
7575
+ */
7576
+ getDurationMs(): number;
7577
+ /** Whether live seeking is enabled for the current source */
7578
+ readonly isLiveSeekingEnabled: boolean;
7579
+ /** Whether the current playback position is live */
7580
+ readonly isCurrentTimeLive: boolean;
7581
+ /**
7582
+ * Handle watermark element changes for security purposes
7583
+ * @param mutations - Array of DOM mutation records
7584
+ */
7585
+ onWatermarkElementChange(mutations: MutationRecord[]): void;
7586
+ }
7587
+
7274
7588
  declare type VideoDetailResponsiveField = OrganizationResponsiveSetting<{
7275
7589
  modalView?: boolean;
7276
7590
  showDateOfPublicationForRelatedVideos?: boolean;
@@ -7828,6 +8142,10 @@ export declare interface WebConfig {
7828
8142
  [key: string]: string;
7829
8143
  };
7830
8144
  };
8145
+ /**
8146
+ * Map for all handlers
8147
+ */
8148
+ handlers?: PurchaseEventHandlers;
7831
8149
  }
7832
8150
 
7833
8151
  /**
@@ -7893,10 +8211,7 @@ export declare interface WebPlayerProps {
7893
8211
  */
7894
8212
  enableKeyboardShortcuts?: boolean;
7895
8213
  onProgress?: (event: React_2.ChangeEvent<HTMLVideoElement>) => void;
7896
- /**
7897
- * @deprecated this callback is never called. Will be removed in @tivio/sdk-react version 4
7898
- */
7899
- onPlayerControllerCreated?: (playerController: any) => void;
8214
+ onPlayerControllerCreated?: (playerController: VideoController) => void;
7900
8215
  /**
7901
8216
  * If true, saving of watch position won't be performed.
7902
8217
  */