@tivio/sdk-react 9.4.0 → 9.5.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.
@@ -1,3 +1,4 @@
1
+ import { AD_SERVICE_PROXY_NAME } from '@tivio/common';
1
2
  import type { ComponentType } from 'react';
2
3
  import type dayjs from 'dayjs';
3
4
  import { DocumentReference } from '@firebase/firestore-types';
@@ -34,6 +35,8 @@ declare interface actualPriceDetails {
34
35
  currency?: primaSupportedCurrency;
35
36
  }
36
37
 
38
+ export { AD_SERVICE_PROXY_NAME }
39
+
37
40
  export declare type AdBannerScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.AD_BANNER>;
38
41
 
39
42
  export declare type AddEditCommentResponse = {
@@ -100,6 +103,7 @@ export declare type AdMetadata = {
100
103
  isSkippable: boolean;
101
104
  order: number | null;
102
105
  totalCount: number | null;
106
+ customAdMetadata?: Record<string, unknown>;
103
107
  skip: () => void;
104
108
  } | null;
105
109
 
@@ -217,6 +221,10 @@ export declare interface AdSourceInterface extends CommonSourceInterface<SourceT
217
221
  skipAll(): void;
218
222
  onRemainingTimeChanged(ms: number): void;
219
223
  click(): void;
224
+ /**
225
+ * Rich IMA ad metadata including customAdMetadata (only available for IMA ads)
226
+ */
227
+ imaAdMetadata?: any;
220
228
  }
221
229
 
222
230
  /**
@@ -675,6 +683,8 @@ export declare interface ButtonOptions {
675
683
  */
676
684
  export declare interface ButtonVariantOptions {
677
685
  border?: string;
686
+ disabledBackgroundColor?: string;
687
+ disabledColor?: string;
678
688
  }
679
689
 
680
690
  /**
@@ -1249,7 +1259,8 @@ export declare enum CustomerId {
1249
1259
  KAROL_A_KVIDO = "KAROL_A_KVIDO",
1250
1260
  UZ_BUDU = "UZ_BUDU",
1251
1261
  PRIMA = "PRIMA",
1252
- NORA_FRIDRICHOVA = "NORA_FRIDRICHOVA"
1262
+ NORA_FRIDRICHOVA = "NORA_FRIDRICHOVA",
1263
+ LONGEVITY = "LONGEVITY"
1253
1264
  }
1254
1265
 
1255
1266
  /**
@@ -1447,6 +1458,15 @@ export declare interface Customizations {
1447
1458
  color?: string;
1448
1459
  backgroundColorActive?: string;
1449
1460
  formBackgroundColor?: string;
1461
+ captionColor?: string;
1462
+ textInputBorder?: string;
1463
+ };
1464
+ MobilePayment?: {
1465
+ backgroundColor?: string;
1466
+ color?: string;
1467
+ backgroundColorActive?: string;
1468
+ formBackgroundColor?: string;
1469
+ captionColor?: string;
1450
1470
  };
1451
1471
  QerkoOverlay?: {
1452
1472
  backgroundColor?: string;
@@ -3349,6 +3369,20 @@ export declare interface PartialRegistrationOverlayContextState {
3349
3369
  voucher?: string;
3350
3370
  }
3351
3371
 
3372
+ /**
3373
+ * @public
3374
+ * Generic interface for sources that can be identified by a path (video or TV channel)
3375
+ */
3376
+ export declare type PathSourceParams = PathSourceParamsTvChannel | PathSourceParamsVideo;
3377
+
3378
+ declare interface PathSourceParamsTvChannel extends Partial<ChannelSourceParams> {
3379
+ path: `tvChannels/${string}`;
3380
+ }
3381
+
3382
+ declare interface PathSourceParamsVideo extends Partial<Omit<VodTivioSourceParams, 'videoPath'>> {
3383
+ path: `videos/${string}`;
3384
+ }
3385
+
3352
3386
  export declare type PatreonCreatorData = {
3353
3387
  campaign: string;
3354
3388
  tiers: Tier[];
@@ -3795,6 +3829,7 @@ export declare interface PlayerSourceInterface<T extends NonAdSourceType = NonAd
3795
3829
  start?: Date;
3796
3830
  from?: Date;
3797
3831
  sourceHistory?: string[];
3832
+ staticAdsConfig?: StaticAdsBreak[];
3798
3833
  }
3799
3834
 
3800
3835
  /**
@@ -3813,6 +3848,7 @@ export declare interface PlayerSourceParams<T extends NonAdSourceType = NonAdSou
3813
3848
  seekingMatrix?: SeekingMatrixTemplate;
3814
3849
  sessionType?: VideoSourceField['sessionType'];
3815
3850
  sessionId?: string;
3851
+ staticAdsConfig?: StaticAdsBreak[];
3816
3852
  }
3817
3853
 
3818
3854
  export declare type PlayersScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.PLAYERS>;
@@ -3973,7 +4009,15 @@ export declare enum PlayerWrapperEvents {
3973
4009
  /**
3974
4010
  * Un-pause was triggered
3975
4011
  */
3976
- 'unpause_triggered' = "unpause_triggered"
4012
+ 'unpause_triggered' = "unpause_triggered",
4013
+ /**
4014
+ * Triggered when an ad starts playing
4015
+ */
4016
+ 'ad_started' = "ad_started",
4017
+ /**
4018
+ * Triggered when an ad finishes playing
4019
+ */
4020
+ 'ad_ended' = "ad_ended"
3977
4021
  }
3978
4022
 
3979
4023
  /**
@@ -4233,6 +4277,11 @@ export declare type Purchase = {
4233
4277
  voucherId: string | null;
4234
4278
  isVoucherActivation?: boolean;
4235
4279
  rebalancingVideoRef?: any;
4280
+ /**
4281
+ * Returns all purchases that are connected via originalPurchaseRef.
4282
+ * For example, if user has subscription purchase, this method will return all purchases that are RENEWED + PAID/CANCELLED latest one.
4283
+ */
4284
+ getRelatedPurchases: () => Promise<Purchase[]>;
4236
4285
  };
4237
4286
 
4238
4287
  /**
@@ -5664,6 +5713,21 @@ export declare interface SimplifiedVideoController {
5664
5713
  muted: boolean;
5665
5714
  volume: number;
5666
5715
  }) => void): void;
5716
+ /**
5717
+ * Add an event listener for ad started events
5718
+ * @param event - Must be 'ad_started'
5719
+ * @param callback - Function called when an ad starts playing
5720
+ */
5721
+ addEventListener(event: 'ad_started', callback: (adMetadata: AdMetadata & {
5722
+ customAdMetadata?: Record<string, unknown> | null;
5723
+ ctaElement: HTMLElement | null;
5724
+ }) => void): void;
5725
+ /**
5726
+ * Add an event listener for ad ended events
5727
+ * @param event - Must be 'ad_ended'
5728
+ * @param callback - Function called when an ad finishes playing
5729
+ */
5730
+ addEventListener(event: 'ad_ended', callback: () => void): void;
5667
5731
  /**
5668
5732
  * Remove an event listener
5669
5733
  * @param event - The event name to stop listening for
@@ -5675,6 +5739,7 @@ export declare interface SimplifiedVideoController {
5675
5739
  * @param source - The new source to load (can be a video path, channel path, or source parameters)
5676
5740
  */
5677
5741
  setSource(source: WebPlayerProps['source']): void;
5742
+ setAdsConfig(adsConfig: StaticAdsBreak[]): void;
5678
5743
  /**
5679
5744
  * Destroy the player and clean up all resources
5680
5745
  */
@@ -5794,6 +5859,19 @@ export declare interface StartLiveStreamResponse {
5794
5859
  error?: string;
5795
5860
  }
5796
5861
 
5862
+ export declare type StaticAdsBreak = StaticAdsBreakPostrollPreroll | StaticAdsBreakMidroll;
5863
+
5864
+ export declare interface StaticAdsBreakMidroll {
5865
+ type: 'midroll';
5866
+ from: number;
5867
+ url: string;
5868
+ }
5869
+
5870
+ declare interface StaticAdsBreakPostrollPreroll {
5871
+ type: 'preroll' | 'postroll';
5872
+ url: string;
5873
+ }
5874
+
5797
5875
  /**
5798
5876
  * @public
5799
5877
  */
@@ -6357,6 +6435,12 @@ export declare interface TivioConfig {
6357
6435
  * (otherwise organizations would share login token).
6358
6436
  */
6359
6437
  customerId?: CustomerId;
6438
+ /**
6439
+ * An optional variable that enables Single Sign-On (SSO) for all subdomains under the same parent domain.
6440
+ * @example
6441
+ * customTokenCookiesDomain: 'example.com'
6442
+ */
6443
+ customTokenCookiesDomain?: string;
6360
6444
  }
6361
6445
 
6362
6446
  /**
@@ -7588,6 +7672,7 @@ export declare enum VastProvider {
7588
7672
  TEST = "test",
7589
7673
  TEST_VPAID = "test-vpaid",
7590
7674
  TIVIO_ADS = "tivio-ads",
7675
+ STATIC_ADS_PROVIDER = "static-ads-provider",
7591
7676
  JOJ_TEST_AD_FORM_PROGRAMMATIC = "joj-test-ad-form-programmatic",
7592
7677
  JOJ_TEST_TESTER_VASTERIX = "joj-test-tester-vasterix",
7593
7678
  JOJ_TEST_TESTER_ADFORM_30 = "joj-test-tester-adform-30"
@@ -7729,6 +7814,9 @@ export declare interface VideoController {
7729
7814
  muted: boolean;
7730
7815
  volume: number;
7731
7816
  }) => void): void;
7817
+ addEventListener(event: 'ad_started', callback: (value: AdMetadata & {
7818
+ adCtaElement: HTMLElement | null;
7819
+ }) => void): void;
7732
7820
  /**
7733
7821
  * Remove an event listener
7734
7822
  * @param event - The event name to stop listening for
@@ -7854,6 +7942,7 @@ export declare interface VideoController {
7854
7942
  * @param mutations - Array of DOM mutation records
7855
7943
  */
7856
7944
  onWatermarkElementChange(mutations: MutationRecord[]): void;
7945
+ setAdCtaElement: (element: HTMLElement | null) => void;
7857
7946
  }
7858
7947
 
7859
7948
  declare type VideoDetailResponsiveField = OrganizationResponsiveSetting<{
@@ -8458,7 +8547,7 @@ export declare interface WebGridScreenProps {
8458
8547
  */
8459
8548
  export declare interface WebPlayerProps {
8460
8549
  id: string;
8461
- source?: InputSourceParams | VideoPath | ChannelPath | null;
8550
+ source?: InputSourceParams | PathSourceParams | VideoPath | ChannelPath | null;
8462
8551
  onEnded?: () => any;
8463
8552
  /**
8464
8553
  * If true, the player will inherit the width and height of its parent element.
@@ -8544,6 +8633,7 @@ export declare interface WebPlayerProps {
8544
8633
  setPaymentOverlayVisible?: React_2.Dispatch<React_2.SetStateAction<boolean>>;
8545
8634
  hideOverlay?: boolean;
8546
8635
  sourcePlayMode?: SourcePlayMode;
8636
+ adsConfig?: StaticAdsBreak[];
8547
8637
  }
8548
8638
 
8549
8639
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tivio/sdk-react",
3
- "version": "9.4.0",
3
+ "version": "9.5.0",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "source": "src/index.ts",
@@ -38,7 +38,7 @@
38
38
  "@material-ui/core": "^4.11.2",
39
39
  "@material-ui/icons": "^4.11.2",
40
40
  "@sentry/browser": "^6.1.0",
41
- "@tivio/common": "1.1.134",
41
+ "@tivio/common": "1.1.135",
42
42
  "dayjs": "^1.11.0",
43
43
  "es7-object-polyfill": "^1.0.1",
44
44
  "firebase": "8.10.1",