@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.
package/dist/index.d.ts CHANGED
@@ -1014,6 +1014,18 @@ export declare interface ConversionsTargetItem {
1014
1014
 
1015
1015
  export declare type CountdownScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.COUNTDOWN>;
1016
1016
 
1017
+ /**
1018
+ * Maps supported country codes (ISO 3166-1 alpha-2) to their primary language codes (ISO 639-1).
1019
+ * Used to determine the default language settings for specific countries.
1020
+ * @example
1021
+ * CountryToLanguageMap['CZ'] // Returns LangCode.CS for Czech Republic
1022
+ */
1023
+ export declare const CountryToLangCodeMap: {
1024
+ CZ: LangCode;
1025
+ PL: LangCode;
1026
+ SK: LangCode;
1027
+ };
1028
+
1017
1029
  /**
1018
1030
  * @public
1019
1031
  * @TODO move somewhere else
@@ -1034,11 +1046,11 @@ export declare const createPubSub: () => PubSub;
1034
1046
  * Fetch & load CommonJS remote module.
1035
1047
  * @public
1036
1048
  */
1037
- export declare const createRemotePackageLoader: () => (secret: string, conf: InternalConfig, checkBundleCharCount?: boolean) => Promise<TivioBundle>;
1049
+ export declare const createRemotePackageLoader: () => (secret: string, conf: InternalConfig, checkBundleCharCount?: boolean, skipCache?: boolean) => Promise<TivioBundle>;
1038
1050
 
1039
1051
  export declare const createTivio: () => (conf: SdkReactConfig) => Promise<RemoteBundleState>;
1040
1052
 
1041
- export declare const createUseRemoteBundle: () => (sdkReactConfig: SdkReactConfig, checkBundleCharCount?: boolean) => RemoteBundleState;
1053
+ export declare const createUseRemoteBundle: () => (sdkReactConfig: SdkReactConfig, checkBundleCharCount?: boolean, skipCache?: boolean) => RemoteBundleState;
1042
1054
 
1043
1055
  export declare interface CreateUserPayload {
1044
1056
  displayName?: string;
@@ -1052,10 +1064,12 @@ export declare interface CreateUserPayload {
1052
1064
  isAnonymous?: boolean;
1053
1065
  }
1054
1066
 
1067
+ export declare type CreateUserProfileRequest = Omit<UserProfile, 'id'>;
1068
+
1055
1069
  /**
1056
1070
  * @public
1057
1071
  */
1058
- export declare type CreateUserWithEmailAndPassword = (email: string, password: string, username?: string, phoneNumber?: string, referralToken?: string) => Promise<string | null>;
1072
+ export declare type CreateUserWithEmailAndPassword = (email: string, password: string, username: string, phoneNumber?: string, referralToken?: string) => Promise<string | null>;
1059
1073
 
1060
1074
  export declare interface CreatorsWithVoucherSubscriptions {
1061
1075
  id: string;
@@ -1112,7 +1126,6 @@ export declare enum CustomerId {
1112
1126
  GRAPE = "GRAPE",
1113
1127
  HODINA_DEJEPICHU = "HODINA_DEJEPICHU",
1114
1128
  INVESTICNI_PRUVODCE = "INVESTICNI_PRUVODCE",
1115
- INVESTOREES = "INVESTOREES",
1116
1129
  JOJ = "JOJ",
1117
1130
  KLUCI_Z_PRAHY = "KLUCI_Z_PRAHY",
1118
1131
  MALL = "MALL",
@@ -1157,7 +1170,8 @@ export declare enum CustomerId {
1157
1170
  BEAT_SEXISM = "BEAT_SEXISM",
1158
1171
  KAROL_A_KVIDO = "KAROL_A_KVIDO",
1159
1172
  UZ_BUDU = "UZ_BUDU",
1160
- PRIMA = "PRIMA"
1173
+ PRIMA = "PRIMA",
1174
+ NORA_FRIDRICHOVA = "NORA_FRIDRICHOVA"
1161
1175
  }
1162
1176
 
1163
1177
  export declare interface CustomScript {
@@ -1289,6 +1303,8 @@ export declare enum DrmProvider {
1289
1303
  * Original oktagon stream provider.
1290
1304
  *
1291
1305
  * https://streamonline.pl
1306
+ *
1307
+ * @deprecated oktagon no longer uses this drm provider.
1292
1308
  */
1293
1309
  STREAMONLINE = "streamonline"
1294
1310
  }
@@ -1432,8 +1448,8 @@ export declare type EmbedScreenPostMessageFn = <T extends EmbedScreenPostMessage
1432
1448
  */
1433
1449
  export declare interface EmitterInterface {
1434
1450
  isSupported: (even: string) => boolean;
1435
- addListener: <T = any>(event: string, cb: (value: T) => Empty_2) => void;
1436
- removeListener: <T = any>(event: string, cb: (value: T) => Empty_2) => void;
1451
+ addListener: <T = unknown>(event: string, cb: (value: T) => Empty_2) => void;
1452
+ removeListener: <T = unknown>(event: string, cb: (value: T) => Empty_2) => void;
1437
1453
  }
1438
1454
 
1439
1455
  /**
@@ -1672,6 +1688,10 @@ export declare interface GetSourceUrlRequest {
1672
1688
  * Start time in ms, for live streams. Will return manifest with desired start.
1673
1689
  */
1674
1690
  startTimeMs?: number;
1691
+ /**
1692
+ * Parameters related to ads.
1693
+ */
1694
+ adParams?: Record<string, string | number | undefined>;
1675
1695
  }
1676
1696
 
1677
1697
  export declare interface GetSourceUrlResponse {
@@ -3111,9 +3131,8 @@ export declare interface PlayerEngineInterface {
3111
3131
  stop(): Promise<void>;
3112
3132
  addEventListener<T>(event: PlayerEngineEvent, callback: PlayerEngineListener<T>): void;
3113
3133
  addEventListener(event: 'statechange', callback: PlayerEngineListener<PlayerState>): void;
3114
- addEventListener(event: 'bufferingchange', callback: PlayerEngineListener<boolean>): void;
3134
+ addEventListener(event: 'bufferingchange' | 'togglefullscreen', callback: PlayerEngineListener<boolean>): void;
3115
3135
  addEventListener(event: 'bufferedinfochange', callback: PlayerEngineListener<BufferPercentChunk[]>): void;
3116
- addEventListener(event: 'togglefullscreen', callback: PlayerEngineListener<boolean>): void;
3117
3136
  removeEventListener<T>(event: PlayerEngineEvent, listener: PlayerEngineListener<T>): void;
3118
3137
  /**
3119
3138
  * @returns currently playing audio track in ISO 639-1 format ('cs', 'en' etc.) or null if not available
@@ -3197,7 +3216,7 @@ export declare interface PlayerEngineInterface {
3197
3216
  /**
3198
3217
  * @public
3199
3218
  */
3200
- export declare type PlayerEngineListener<T> = (value: T) => any;
3219
+ export declare type PlayerEngineListener<T> = (value: T) => void;
3201
3220
 
3202
3221
  /**
3203
3222
  * @public
@@ -3964,6 +3983,14 @@ export declare type PurchaseEndpointPayload = {
3964
3983
  };
3965
3984
  };
3966
3985
 
3986
+ /**
3987
+ * @public
3988
+ */
3989
+ export declare type PurchaseEventHandlers = {
3990
+ onPurchaseIntention?: (purchase: PurchasableMonetization) => void;
3991
+ onPurchaseFinished?: (purchase: Purchase) => void;
3992
+ };
3993
+
3967
3994
  /**
3968
3995
  * @public
3969
3996
  */
@@ -4398,7 +4425,7 @@ export declare interface RenderConditionValue {
4398
4425
  subscriptionRefs?: any[];
4399
4426
  }
4400
4427
 
4401
- export declare const renderWebPlayer: (container: HTMLElement, props: WebPlayerProps) => void;
4428
+ export declare const renderWebPlayer: (container: HTMLElement, props: Omit<WebPlayerProps, 'onPlayerControllerCreated'>) => Promise<SimplifiedVideoController>;
4402
4429
 
4403
4430
  /**
4404
4431
  * Make all attributes in given type required, non-nullable and defined.
@@ -4782,6 +4809,7 @@ declare interface Screen_2 {
4782
4809
  fetchMoreRows: () => Promise<void>;
4783
4810
  hasNextPage: boolean;
4784
4811
  refetchIfNeeded: () => Promise<void>;
4812
+ allowOrganizationBanner?: boolean;
4785
4813
  }
4786
4814
  export { Screen_2 as Screen }
4787
4815
 
@@ -5031,6 +5059,110 @@ export declare const showGdprConsentPreferences: () => Promise<void>;
5031
5059
  */
5032
5060
  export declare type SignInProvider = 'google' | 'patreon' | 'apple';
5033
5061
 
5062
+ /**
5063
+ * Simplified VideoController interface for external rendering
5064
+ */
5065
+ export declare interface SimplifiedVideoController {
5066
+ /**
5067
+ * Resume playback from paused state
5068
+ */
5069
+ play(): void;
5070
+ /**
5071
+ * Pause the current playback
5072
+ */
5073
+ pause(): void;
5074
+ /**
5075
+ * Toggle between play and pause states
5076
+ */
5077
+ togglePause(): void;
5078
+ /**
5079
+ * Replay the current video from the beginning
5080
+ */
5081
+ replay(): Promise<void>;
5082
+ /**
5083
+ * Retry playback if it failed to start
5084
+ */
5085
+ retry(): void;
5086
+ /**
5087
+ * Seek to an absolute position in milliseconds
5088
+ * @param ms - Position in milliseconds from the start of the video
5089
+ */
5090
+ seekToAbsolutePosition(ms: number): void;
5091
+ /**
5092
+ * Seek relative to current position
5093
+ * @param ms - Number of milliseconds to seek (positive for forward, negative for backward)
5094
+ */
5095
+ seekBy(ms: number): void;
5096
+ /**
5097
+ * Seek to a percentage of the video duration
5098
+ * @param percentage - Percentage value between 0 and 100
5099
+ */
5100
+ seekToPercent(percentage: number): void;
5101
+ /**
5102
+ * Seek to the live position for live streams
5103
+ */
5104
+ seekToLive(): void;
5105
+ /**
5106
+ * Set the volume level
5107
+ * @param value - Volume level between 0 and 1
5108
+ */
5109
+ changeVolume(value: number): void;
5110
+ /**
5111
+ * Increase volume by 5%
5112
+ */
5113
+ volumeUp(): void;
5114
+ /**
5115
+ * Decrease volume by 5%
5116
+ */
5117
+ volumeDown(): void;
5118
+ /**
5119
+ * Mute the audio
5120
+ */
5121
+ mute(): void;
5122
+ /**
5123
+ * Unmute the audio
5124
+ */
5125
+ unmute(): void;
5126
+ /**
5127
+ * Toggle between muted and unmuted states
5128
+ */
5129
+ toggleMute(): void;
5130
+ /**
5131
+ * Currently playing source or null if no source is loaded
5132
+ */
5133
+ readonly currentSource: PlayerSource | null;
5134
+ /**
5135
+ * Add an event listener for player events
5136
+ * @param event - The event name to listen for (e.g., 'ended', 'timeupdate', 'statechange')
5137
+ * @param callback - Function to call when the event occurs
5138
+ */
5139
+ addEventListener<T>(event: string, callback: (value: T) => void): void;
5140
+ /**
5141
+ * Add an event listener for volume changes
5142
+ * @param event - Must be 'volumechange'
5143
+ * @param callback - Function called with volume state object
5144
+ */
5145
+ addEventListener(event: 'volumechange', callback: (value: {
5146
+ muted: boolean;
5147
+ volume: number;
5148
+ }) => void): void;
5149
+ /**
5150
+ * Remove an event listener
5151
+ * @param event - The event name to stop listening for
5152
+ * @param callback - The callback function to remove
5153
+ */
5154
+ removeEventListener<T>(event: string, callback: (value: T) => void): void;
5155
+ /**
5156
+ * Change the current source to a new one
5157
+ * @param source - The new source to load (can be a video path, channel path, or source parameters)
5158
+ */
5159
+ setSource(source: WebPlayerProps['source']): void;
5160
+ /**
5161
+ * Destroy the player and clean up all resources
5162
+ */
5163
+ destroy(): Promise<void>;
5164
+ }
5165
+
5034
5166
  export declare enum SocialNetworks {
5035
5167
  FACEBOOK = 0,
5036
5168
  INSTAGRAM = 1,
@@ -5469,20 +5601,27 @@ export declare type TivioAnalytics = {
5469
5601
  */
5470
5602
  export declare interface TivioAuth {
5471
5603
  /**
5604
+ * Create and sign up new user with given email and password.
5472
5605
  * @param email
5473
5606
  * @param password
5607
+ * @returns {string} - uid of newly created and signed-up user
5474
5608
  */
5475
5609
  createUserWithEmailAndPassword: CreateUserWithEmailAndPassword;
5476
5610
  /**
5477
- * Sign in the user and starts listening on his purchases
5611
+ * Sign in the user with given email and password and start listening on their purchases.
5478
5612
  * @param email
5479
5613
  * @param password
5614
+ * @returns {string} - uid of signed-in user.
5480
5615
  */
5481
5616
  signInWithEmailAndPassword: (email: string, password: string) => Promise<string | null>;
5482
5617
  signInWithCustomToken: (token: string) => Promise<string | null>;
5618
+ /**
5619
+ * Signs out currently signed-in user.
5620
+ */
5483
5621
  signOut: () => Promise<void>;
5484
5622
  /**
5485
- * Used for reset forgotten password by user
5623
+ * Resets password for given user email.
5624
+ * @param email
5486
5625
  */
5487
5626
  resetPassword: (email: string) => Promise<void>;
5488
5627
  }
@@ -5509,7 +5648,6 @@ export declare interface TivioComponents {
5509
5648
  }>;
5510
5649
  Provider: React_2.ComponentType<RemoteProviderProps>;
5511
5650
  WebPlayer: React_2.ComponentType<WebPlayerProps>;
5512
- Widget: React_2.ComponentType<TivioWidgetProps>;
5513
5651
  PlayerDataContextProvider: React_2.ComponentType<{
5514
5652
  id: string;
5515
5653
  }>;
@@ -5538,9 +5676,7 @@ export declare interface TivioComponents {
5538
5676
  WebTile: React_2.ComponentType<{
5539
5677
  item?: ItemInRow;
5540
5678
  } & TilePropsPartial>;
5541
- ChannelContext: React_2.Context<TvChannel | undefined>;
5542
5679
  ContentSortPicker: React_2.ComponentType<ContentSortPickerProps>;
5543
- WebProfileScreen: React_2.ComponentType<WebProfileScreenProps>;
5544
5680
  WebTivioProVideoScreen: React_2.ComponentType<WebTivioProVideoScreenProps>;
5545
5681
  RemoteController: React_2.ComponentType<RemoteControllerProps>;
5546
5682
  }
@@ -5566,14 +5702,24 @@ export declare interface TivioConfig {
5566
5702
  preferHttp?: boolean;
5567
5703
  };
5568
5704
  secret: string;
5705
+ /**
5706
+ * Language used when isLanguageSelectionEnabled is false | undefined or when not possible to load language from local storage or localization worker
5707
+ */
5569
5708
  language: LangCode;
5570
5709
  debug?: boolean;
5571
5710
  verbose?: boolean;
5572
5711
  firebaseApp?: any | null;
5573
- firebaseFactory?: (config: Object, appName?: string) => firebase_2.FirebaseApp;
5712
+ firebaseFactory?: (config: object, appName?: string) => firebase_2.FirebaseApp;
5574
5713
  authDomainOverride?: string;
5575
5714
  firestore?: any | null;
5576
5715
  currency: Currency;
5716
+ /**
5717
+ * A flag that indicates whether the language selection feature is enabled.
5718
+ * Language is then stored to local storage 'tivio-user-language'.
5719
+ * If nothing is stored in local storage, then language is set according to location
5720
+ * When set to `true`, users are allowed to choose their preferred language
5721
+ */
5722
+ isLanguageSelectionEnabled?: boolean;
5577
5723
  applicationId?: string;
5578
5724
  isTivioProApp?: boolean;
5579
5725
  lockApplicationHandle?: string;
@@ -5625,13 +5771,13 @@ export declare type TivioGetters = {
5625
5771
  /**
5626
5772
  * Get video by its id.
5627
5773
  * @param videoId - video id
5628
- * @returns {Promise<Video | null>} video or null if video does not exists
5774
+ * @returns {Promise<Video | null>} video or null if video does not exist
5629
5775
  */
5630
5776
  getVideoById: (videoId: string) => Promise<Video | null>;
5631
5777
  /**
5632
5778
  * Get screen by its id.
5633
5779
  * @param screenId - screen id
5634
- * @returns {Promise<Screen | null>} screen or null if screen does not exists
5780
+ * @returns {Promise<Screen | null>} screen or null if screen does not exist
5635
5781
  */
5636
5782
  getScreenById: (screenId: string, cb?: (error: Error | null, data: Screen_2 | null, disposer?: Disposer_2) => void) => Promise<Screen_2 | null>;
5637
5783
  /**
@@ -5639,6 +5785,11 @@ export declare type TivioGetters = {
5639
5785
  * @returns PlayerCapability[]
5640
5786
  */
5641
5787
  getPlayerCapabilities: () => PlayerCapability[];
5788
+ /**
5789
+ * Get currently logged-in user. If no user is logged in, returns `null`.
5790
+ * @returns User
5791
+ */
5792
+ getUser: () => User | null;
5642
5793
  };
5643
5794
 
5644
5795
  /**
@@ -5794,6 +5945,9 @@ export declare type TivioInternalProviders = {
5794
5945
  }>;
5795
5946
  MonetizationsSelectOverlayContextProvider: React_2.ComponentType;
5796
5947
  QerkoOverlayContextProvider: React_2.ComponentType;
5948
+ /**
5949
+ * @deprecated do not use, this provider will be removed in the future
5950
+ */
5797
5951
  PurchasesWithVideosContextProvider: React_2.ComponentType<{
5798
5952
  children?: React_2.ReactNode;
5799
5953
  }>;
@@ -5834,7 +5988,7 @@ export declare type TivioJsBundleExposedApi = {
5834
5988
  getTagById: (tagId: string) => Promise<Tag | null>;
5835
5989
  createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
5836
5990
  destroy: () => Promise<void>;
5837
- } & Pick<TivioGetters, 'getVideoById' | 'getScreenById' | 'organization'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow' | 'subscribeToRowsInScreen'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
5991
+ } & Pick<TivioGetters, 'getVideoById' | 'getScreenById' | 'organization' | 'getUser'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow' | 'subscribeToRowsInScreen'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword' | 'resetPassword' | 'signOut'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
5838
5992
 
5839
5993
  /**
5840
5994
  * @public
@@ -5951,55 +6105,6 @@ export declare type TivioVodSource = SourceBase & StartAndContinuePosition & {
5951
6105
  videoPath: string;
5952
6106
  };
5953
6107
 
5954
- /**
5955
- * @public
5956
- */
5957
- export declare const TivioWidget: React_2.ForwardRefExoticComponent<Omit<TivioWidgetProps, "ref"> & React_2.RefAttributes<TivioWidgetRef>>;
5958
-
5959
- /**
5960
- * @public
5961
- */
5962
- export declare const TivioWidgetError: React_2.FC<TivioWidgetErrorProps>;
5963
-
5964
- declare type TivioWidgetErrorProps = {
5965
- error: string | null;
5966
- };
5967
-
5968
- /**
5969
- * @public
5970
- */
5971
- export declare const TivioWidgetLoader: React_2.FC;
5972
-
5973
- /**
5974
- * @public
5975
- */
5976
- export declare interface TivioWidgetProps {
5977
- id: string;
5978
- ref: React_2.MutableRefObject<TivioWidgetRef>;
5979
- onEnabled?: (enabled: boolean) => any;
5980
- onBlur?: (event: {
5981
- key: string;
5982
- width: number;
5983
- x: number;
5984
- }) => any;
5985
- }
5986
-
5987
- /**
5988
- * @public
5989
- */
5990
- export declare interface TivioWidgetRef {
5991
- focus: (args: {
5992
- x?: number;
5993
- }) => void;
5994
- handleKey: (key: string) => ({
5995
- handled: boolean;
5996
- x: number;
5997
- });
5998
- unfocus: () => ({
5999
- x: number;
6000
- });
6001
- }
6002
-
6003
6108
  export declare interface TokenInterface {
6004
6109
  token: string;
6005
6110
  expirationDate: Date;
@@ -6476,18 +6581,45 @@ export declare type User = {
6476
6581
  isPurchasesInitialized: boolean;
6477
6582
  isSignedIn: boolean;
6478
6583
  isReady: boolean;
6584
+ /**
6585
+ * Email of this user.
6586
+ */
6479
6587
  email?: string;
6480
6588
  type?: UserType;
6481
6589
  photoURL: string | null;
6590
+ /**
6591
+ * Name of this user - typically first and last name combined, or any other nickname chosen by user.
6592
+ */
6482
6593
  name?: string;
6483
6594
  /**
6484
6595
  * Authentication id differs from {@link id}.
6485
6596
  */
6486
6597
  authUserId?: string;
6598
+ /**
6599
+ * List of content (e.g. videos / series) that user marked as their favorite.
6600
+ * Changes based on currently {@link activeUserProfileId}
6601
+ */
6487
6602
  favorites: any[];
6603
+ /**
6604
+ * List of content (e.g. videos / series) that user watched recently with precise time position where they last left watching.
6605
+ * Number of entries in the list is limited by constant number (i.e. older entries are deleted when limit is reached).
6606
+ * In some cases entries are actively removed even if they are new, for example when user watched video to the end.
6607
+ * Changes based on currently {@link activeUserProfileId}.
6608
+ */
6488
6609
  watchedPositions: any[];
6610
+ /**
6611
+ * Similar to {@link watchedPositions}, but has higher limit for number of entries,
6612
+ * and they never actively deleted (e.g. when user watched video to the end)
6613
+ * Changes based on currently {@link activeUserProfileId}.
6614
+ */
6489
6615
  watchHistory: any[];
6490
- profiles: any[];
6616
+ /**
6617
+ * List of profiles for this user.
6618
+ */
6619
+ profiles: UserProfile[];
6620
+ /**
6621
+ * Currently active user profile id.
6622
+ */
6491
6623
  activeUserProfileId: string | null;
6492
6624
  patreon?: PatreonUserAuth;
6493
6625
  subscriptionIdsToShow: string[] | null;
@@ -6495,9 +6627,22 @@ export declare type User = {
6495
6627
  isAnonymous: boolean;
6496
6628
  isDiscordConnected: boolean;
6497
6629
  disconnectDiscord: () => Promise<void>;
6498
- createUserProfile: (request: any) => Promise<void>;
6630
+ /**
6631
+ * Create new profile for this user.
6632
+ * @param request
6633
+ */
6634
+ createUserProfile: (request: CreateUserProfileRequest) => Promise<void>;
6635
+ /**
6636
+ * Delete given profile from this user.
6637
+ * @param profileId
6638
+ */
6499
6639
  deleteUserProfile: (profileId: string) => Promise<void>;
6500
- setActiveUserProfileId: (id: string) => void;
6640
+ /**
6641
+ * Activate given profile for this user.
6642
+ * After activation {@link favorites}, {@link watchedPositions} and {@link watchHistory} of given profile will be used.
6643
+ * @param profileId
6644
+ */
6645
+ setActiveUserProfileId: (profileId: string) => void;
6501
6646
  getFollowedOrganizations: () => Promise<Array<FollowedOrganizationData | undefined>>;
6502
6647
  sendFinalizeRegistrationEmail: (email: string) => Promise<void>;
6503
6648
  isUserAlreadyRegisteredByTenant: (email: string) => Promise<boolean>;
@@ -6896,6 +7041,154 @@ export declare enum VideoContentType {
6896
7041
  SERIES = "SERIES"
6897
7042
  }
6898
7043
 
7044
+ /**
7045
+ * @public
7046
+ * VideoController provides control over video playback, seeking, volume, and event handling.
7047
+ */
7048
+ export declare interface VideoController {
7049
+ /** Unique identifier for this player instance */
7050
+ readonly playerId: string;
7051
+ /** Internal control queue for managing player operations */
7052
+ readonly controlQueue: unknown;
7053
+ /** Currently playing source or null if no source is loaded */
7054
+ readonly currentSource: PlayerSource | null;
7055
+ /**
7056
+ * Add an event listener for player events
7057
+ * @param event - The event name to listen for (e.g., 'ended', 'timeupdate', 'statechange')
7058
+ * @param callback - Function to call when the event occurs
7059
+ */
7060
+ addEventListener<T>(event: string, callback: (value: T) => void): void;
7061
+ addEventListener(event: 'volumechange', callback: (value: {
7062
+ muted: boolean;
7063
+ volume: number;
7064
+ }) => void): void;
7065
+ /**
7066
+ * Remove an event listener
7067
+ * @param event - The event name to stop listening for
7068
+ * @param callback - The callback function to remove
7069
+ */
7070
+ removeEventListener<T>(event: string, callback: (value: T) => void): void;
7071
+ /**
7072
+ * Change the current source to a new one
7073
+ * @param sourceData - The new source parameters
7074
+ * @param autoplay - Whether to start playing immediately (default: true)
7075
+ * @returns Promise that resolves to the new source or null if failed
7076
+ */
7077
+ changeSource(sourceData: SourceParams, autoplay?: boolean): Promise<PlayerSource | null>;
7078
+ /**
7079
+ * Load a new source and optionally start playing
7080
+ * @param sourceData - The source parameters to load
7081
+ * @param autoplay - Whether to start playing immediately
7082
+ */
7083
+ load(sourceData: SourceParams, autoplay: boolean): Promise<void>;
7084
+ /**
7085
+ * Toggle between play and pause states
7086
+ */
7087
+ togglePause(): void;
7088
+ /**
7089
+ * Pause the current playback
7090
+ */
7091
+ pause(): void;
7092
+ /**
7093
+ * Resume playback from paused state
7094
+ */
7095
+ unpause(): void;
7096
+ /**
7097
+ * Replay the current video from the beginning
7098
+ */
7099
+ replay(): Promise<void>;
7100
+ /**
7101
+ * Retry playback if it failed to start
7102
+ */
7103
+ retry(): void;
7104
+ /**
7105
+ * Stop playback and reset player state
7106
+ */
7107
+ close(): void;
7108
+ /**
7109
+ * Destroy the player and clean up all resources
7110
+ */
7111
+ destroy(): Promise<void>;
7112
+ /**
7113
+ * Seek to an absolute position in milliseconds
7114
+ * @param ms - Position in milliseconds from the start of the video
7115
+ */
7116
+ seekToAbsolutePosition(ms: number): void;
7117
+ /**
7118
+ * Seek relative to current position
7119
+ * @param ms - Number of milliseconds to seek (positive for forward, negative for backward)
7120
+ */
7121
+ seekBy(ms: number): void;
7122
+ /**
7123
+ * Seek to a percentage of the video duration
7124
+ * @param percentage - Percentage value between 0 and 100
7125
+ */
7126
+ seekToPercent(percentage: number): void;
7127
+ /**
7128
+ * @deprecated Use seekToPercent instead
7129
+ * Seek to a relative position as percentage of video duration
7130
+ * @param percentage - Percentage value between 0 and 100
7131
+ */
7132
+ seekToRelativePosition(percentage: number): void;
7133
+ /**
7134
+ * Seek to the live position for live streams
7135
+ */
7136
+ seekToLive(): void;
7137
+ /**
7138
+ * Internal method to seek to live position
7139
+ */
7140
+ seekToLiveInternal(): void;
7141
+ /**
7142
+ * Set the volume level
7143
+ * @param value - Volume level between 0 and 1
7144
+ */
7145
+ changeVolume(value: number): void;
7146
+ /**
7147
+ * Increase volume by 5%
7148
+ */
7149
+ volumeUp(): void;
7150
+ /**
7151
+ * Decrease volume by 5%
7152
+ */
7153
+ volumeDown(): void;
7154
+ /**
7155
+ * Mute the audio
7156
+ */
7157
+ mute(): void;
7158
+ /**
7159
+ * Unmute the audio
7160
+ */
7161
+ unmute(): void;
7162
+ /**
7163
+ * Toggle between muted and unmuted states
7164
+ */
7165
+ toggleMute(): void;
7166
+ /**
7167
+ * Enter fullscreen mode
7168
+ */
7169
+ goFullScreen(): Promise<void>;
7170
+ /**
7171
+ * @deprecated Use durationchange event instead
7172
+ * Set the duration of the current video in milliseconds
7173
+ * @param ms - Duration in milliseconds
7174
+ */
7175
+ setDurationMs(ms: number): void;
7176
+ /**
7177
+ * Get the duration of the current video in milliseconds
7178
+ * @returns Duration in milliseconds
7179
+ */
7180
+ getDurationMs(): number;
7181
+ /** Whether live seeking is enabled for the current source */
7182
+ readonly isLiveSeekingEnabled: boolean;
7183
+ /** Whether the current playback position is live */
7184
+ readonly isCurrentTimeLive: boolean;
7185
+ /**
7186
+ * Handle watermark element changes for security purposes
7187
+ * @param mutations - Array of DOM mutation records
7188
+ */
7189
+ onWatermarkElementChange(mutations: MutationRecord[]): void;
7190
+ }
7191
+
6899
7192
  declare type VideoDetailResponsiveField = OrganizationResponsiveSetting<{
6900
7193
  modalView?: boolean;
6901
7194
  showDateOfPublicationForRelatedVideos?: boolean;
@@ -7453,6 +7746,10 @@ export declare interface WebConfig {
7453
7746
  [key: string]: string;
7454
7747
  };
7455
7748
  };
7749
+ /**
7750
+ * Map for all handlers
7751
+ */
7752
+ handlers?: PurchaseEventHandlers;
7456
7753
  }
7457
7754
 
7458
7755
  /**
@@ -7518,10 +7815,7 @@ export declare interface WebPlayerProps {
7518
7815
  */
7519
7816
  enableKeyboardShortcuts?: boolean;
7520
7817
  onProgress?: (event: React_2.ChangeEvent<HTMLVideoElement>) => void;
7521
- /**
7522
- * @deprecated this callback is never called. Will be removed in @tivio/sdk-react version 4
7523
- */
7524
- onPlayerControllerCreated?: (playerController: any) => void;
7818
+ onPlayerControllerCreated?: (playerController: VideoController) => void;
7525
7819
  /**
7526
7820
  * If true, saving of watch position won't be performed.
7527
7821
  */