@tivio/sdk-react 9.6.0 → 9.7.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/README.md CHANGED
@@ -1013,6 +1013,22 @@ videoController.addEventListener('ad-started', (adMetadata: AdMetadata | null) =
1013
1013
  videoController.addEventListener('ad-ended', () => {
1014
1014
  console.log('Ad finished playing')
1015
1015
  })
1016
+
1017
+ // Companion ads event - fires when companion ads are available for the current ad
1018
+ videoController.addEventListener('companion-ads', (companionAds) => {
1019
+ console.log('Companion ads available:', companionAds)
1020
+
1021
+ // Access companion ad properties using IMA methods
1022
+ companionAds.forEach((companionAd, index) => {
1023
+ console.log(`Companion Ad ${index + 1}:`, {
1024
+ width: companionAd.getWidth(),
1025
+ height: companionAd.getHeight(),
1026
+ contentType: companionAd.getContentType(),
1027
+ // HTML content as string
1028
+ content: companionAd.getContent()
1029
+ })
1030
+ })
1031
+ })
1016
1032
  ```
1017
1033
 
1018
1034
  > ℹ️ **_Note:_** The CTA overlay element is visible in the WebPlayer only while an ad is playing and is automatically cleaned up on source changes.
package/README.md.bak CHANGED
@@ -1013,6 +1013,22 @@ videoController.addEventListener('ad-started', (adMetadata: AdMetadata | null) =
1013
1013
  videoController.addEventListener('ad-ended', () => {
1014
1014
  console.log('Ad finished playing')
1015
1015
  })
1016
+
1017
+ // Companion ads event - fires when companion ads are available for the current ad
1018
+ videoController.addEventListener('companion-ads', (companionAds) => {
1019
+ console.log('Companion ads available:', companionAds)
1020
+
1021
+ // Access companion ad properties using IMA methods
1022
+ companionAds.forEach((companionAd, index) => {
1023
+ console.log(`Companion Ad ${index + 1}:`, {
1024
+ width: companionAd.getWidth(),
1025
+ height: companionAd.getHeight(),
1026
+ contentType: companionAd.getContentType(),
1027
+ // HTML content as string
1028
+ content: companionAd.getContent()
1029
+ })
1030
+ })
1031
+ })
1016
1032
  ```
1017
1033
 
1018
1034
  > ℹ️ **_Note:_** The CTA overlay element is visible in the WebPlayer only while an ad is playing and is automatically cleaned up on source changes.
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ import type { default as firebase_2 } from '@firebase/app-types';
7
7
  import type { default as firebase_3 } from 'firebase';
8
8
  import { FunctionComponentElement } from 'react';
9
9
  import type { GeoPoint } from '@firebase/firestore-types';
10
+ import type { google } from '@alugha/ima';
10
11
  import { OperatingSystem } from 'detect-browser';
11
12
  import type { PaletteType } from '@material-ui/core';
12
13
  import { default as React_2 } from 'react';
@@ -429,6 +430,8 @@ export declare interface Article extends RowItem, MonetizableItem, ReactableCont
429
430
  detailBanner?: string;
430
431
  episodeNumber?: number;
431
432
  seasonNumber?: number;
433
+ urlNames?: string[];
434
+ urlName?: string;
432
435
  }
433
436
 
434
437
  /**
@@ -440,10 +443,13 @@ export declare interface ArticleBlock {
440
443
  type: ArticleBlockType;
441
444
  htmlContent?: string;
442
445
  imageUrl?: string;
446
+ imageUrlOriginal?: string;
447
+ imageUrlContain?: string;
443
448
  textContent?: string;
444
449
  videoId?: string;
445
450
  isOverflowImage?: boolean;
446
451
  imageDescription?: string;
452
+ use16By9Container?: boolean;
447
453
  }
448
454
 
449
455
  export declare interface ArticleBlockField extends Omit<ArticleBlock, 'textContent' | 'htmlContent'> {
@@ -462,6 +468,7 @@ export declare type ArticleBlockType = 'PARAGRAPH' | 'IMAGE' | 'VIDEO' | 'HEADIN
462
468
  */
463
469
  declare interface ArticleDocumentSerialized {
464
470
  type: 'ARTICLE';
471
+ id: string;
465
472
  name: Translation;
466
473
  description?: Translation;
467
474
  metadata?: ArticleMetadata;
@@ -503,6 +510,7 @@ export declare interface ArticleTileSpecificData {
503
510
  description?: Translation;
504
511
  monetizations?: TileMonetizationData[];
505
512
  externalUrl?: string;
513
+ urlName?: UrlNamesType;
506
514
  }
507
515
 
508
516
  /**
@@ -811,6 +819,12 @@ export declare interface CommonSourceParams<T extends SourceType = SourceType> {
811
819
  videoPath?: string;
812
820
  }
813
821
 
822
+ /**
823
+ * @public
824
+ * Re-export of Google IMA CompanionAd type for use throughout the SDK
825
+ */
826
+ export declare type CompanionAd = google.ima.CompanionAd;
827
+
814
828
  /**
815
829
  * Just another alias. Reexported for backward compatibility.
816
830
  * @public
@@ -1071,6 +1085,9 @@ export declare const CountryToLangCodeMap: {
1071
1085
  CZ: LangCode;
1072
1086
  PL: LangCode;
1073
1087
  SK: LangCode;
1088
+ DE: LangCode;
1089
+ AT: LangCode;
1090
+ CH: LangCode;
1074
1091
  };
1075
1092
 
1076
1093
  /**
@@ -1210,6 +1227,7 @@ export declare enum CustomerId {
1210
1227
  MIRA_BOSAK = "MIRA_BOSAK",
1211
1228
  KOVACIC_360 = "KOVACIC_360",
1212
1229
  SIFRA_TV = "SIFRA_TV",
1230
+ TBL = "TBL",
1213
1231
  BLESK = "BLESK",
1214
1232
  NERUDA_TV = "NERUDA_TV",
1215
1233
  DAVID_FRANK_TV = "DAVID_FRANK_TV",
@@ -1226,6 +1244,7 @@ export declare interface CustomScript {
1226
1244
  src: string;
1227
1245
  event?: EventName;
1228
1246
  isAsync?: boolean;
1247
+ defer?: boolean;
1229
1248
  }
1230
1249
 
1231
1250
  /**
@@ -1510,6 +1529,7 @@ export declare interface EmitterInterface {
1510
1529
  isSupported: (even: string) => boolean;
1511
1530
  addListener: <T = unknown>(event: string, cb: (value: T) => Empty_2) => void;
1512
1531
  removeListener: <T = unknown>(event: string, cb: (value: T) => Empty_2) => void;
1532
+ emitEvent: (event: string, value?: unknown) => void;
1513
1533
  }
1514
1534
 
1515
1535
  /**
@@ -1576,6 +1596,15 @@ export declare const fetchBundle: (secret: string, conf: InternalConfig, checkBu
1576
1596
  */
1577
1597
  declare type FetchPackage = (url: string) => Promise<string>;
1578
1598
 
1599
+ export declare interface FinishSignUpRequest {
1600
+ token: string;
1601
+ fName: string;
1602
+ lName: string;
1603
+ email: string;
1604
+ password: string;
1605
+ langCode?: LangCode;
1606
+ }
1607
+
1579
1608
  /**
1580
1609
  * @public
1581
1610
  */
@@ -1666,9 +1695,13 @@ export declare type GeoBlocking = {
1666
1695
  blacklist: Array<any>;
1667
1696
  };
1668
1697
 
1669
- export declare interface GetArticleRequest {
1698
+ export declare type GetArticleRequest = {
1670
1699
  id: string;
1671
- }
1700
+ } | {
1701
+ idOrUrlName: string;
1702
+ organizationId: string;
1703
+ language: LangCode;
1704
+ };
1672
1705
 
1673
1706
  export declare interface GetArticleResponse {
1674
1707
  article: ArticleDocumentSerialized;
@@ -2281,12 +2314,16 @@ export declare enum LangCode {
2281
2314
  HU = "hu"
2282
2315
  }
2283
2316
 
2317
+ export declare const LangCodeToTitle: Partial<Record<LangCode, string>>;
2318
+
2284
2319
  /**
2285
2320
  * All supported languages codes as in ISO 639-1
2286
2321
  * @public
2287
2322
  */
2288
2323
  export declare const languages: LangCode[];
2289
2324
 
2325
+ export declare type LanguageSelector = 'application' | 'content';
2326
+
2290
2327
  /**
2291
2328
  * Possible language key of all supported language mutations.
2292
2329
  * @public
@@ -2335,7 +2372,13 @@ export declare interface LeaderboardsRequest {
2335
2372
  */
2336
2373
  export declare interface LinkedVideo {
2337
2374
  video: Video;
2338
- type: 'CUT' | 'TRAILER' | 'BONUS' | 'CHILD' | 'TEASER' | 'TASTING' | 'VIRTUAL_PROGRAM' | 'LANGUAGE'
2375
+ type: 'CUT' | 'TRAILER' | 'BONUS' | 'CHILD'
2376
+ /**
2377
+ * Recommendation for the video that appears ahead of
2378
+ * algorithmic recommendations on the detail page. Works one-way: if A
2379
+ * links to B, B is recommended for A only (unless B links back).
2380
+ */
2381
+ | 'RECOMMENDED' | 'TEASER' | 'TASTING' | 'VIRTUAL_PROGRAM' | 'LANGUAGE'
2339
2382
  /**
2340
2383
  * Will render separate mini-player on top of the main one, playing given video.
2341
2384
  */
@@ -2875,11 +2918,6 @@ export declare type Nullable<T> = {
2875
2918
  [P in keyof T]: T[P] | null;
2876
2919
  };
2877
2920
 
2878
- /**
2879
- * @public
2880
- */
2881
- export declare type ObjectType = Record<string, any>;
2882
-
2883
2921
  /**
2884
2922
  * @public
2885
2923
  */
@@ -3625,6 +3663,7 @@ export declare interface PlayerWrapper {
3625
3663
  isPaused: boolean;
3626
3664
  isPlaying: boolean;
3627
3665
  isIdle: boolean;
3666
+ isFullscreen: boolean;
3628
3667
  language: LangCode | null;
3629
3668
  nextRecommendedVideo: Video | null;
3630
3669
  prerollCheck: PrerollCheck;
@@ -3714,7 +3753,11 @@ export declare enum PlayerWrapperEvents {
3714
3753
  /**
3715
3754
  * Triggered when an ad finishes playing
3716
3755
  */
3717
- 'ad-ended' = "ad-ended"
3756
+ 'ad-ended' = "ad-ended",
3757
+ /**
3758
+ * Triggered when companion ads are available for the current ad
3759
+ */
3760
+ 'companion-ads' = "companion-ads"
3718
3761
  }
3719
3762
 
3720
3763
  /**
@@ -5424,6 +5467,12 @@ export declare interface SimplifiedVideoController {
5424
5467
  * @param callback - Function called when an ad finishes playing
5425
5468
  */
5426
5469
  addEventListener(event: 'ad-ended', callback: () => void): void;
5470
+ /**
5471
+ * Add an event listener for companion ads events
5472
+ * @param event - Must be 'companion-ads'
5473
+ * @param callback - Function called when companion ads are available
5474
+ */
5475
+ addEventListener(event: 'companion-ads', callback: (companionAds: CompanionAd[]) => void): void;
5427
5476
  /**
5428
5477
  * Remove an event listener
5429
5478
  * @param event - The event name to stop listening for
@@ -6012,7 +6061,7 @@ export declare interface TivioConfig {
6012
6061
  };
6013
6062
  secret: string;
6014
6063
  /**
6015
- * Language used when isLanguageSelectionEnabled is false | undefined or when not possible to load language from local storage or localization worker
6064
+ * Language used when no languageSelector is set or when not possible to load language from local storage or localization worker
6016
6065
  */
6017
6066
  language: LangCode;
6018
6067
  debug?: boolean;
@@ -6020,15 +6069,16 @@ export declare interface TivioConfig {
6020
6069
  firebaseApp?: any | null;
6021
6070
  firebaseFactory?: (config: object, appName?: string) => firebase_2.FirebaseApp;
6022
6071
  authDomainOverride?: string;
6072
+ /**
6073
+ * @deprecated this field is no longer in use and has no impact when set.
6074
+ */
6023
6075
  firestore?: any | null;
6024
6076
  currency: Currency;
6025
6077
  /**
6026
- * A flag that indicates whether the language selection feature is enabled.
6027
- * Language is then stored to local storage 'tivio-user-language'.
6028
- * If nothing is stored in local storage, then language is set according to location
6029
- * When set to `true`, users are allowed to choose their preferred language
6078
+ * Represents an optional array of LanguageSelector objects.
6079
+ * Used to define and manage a list of supported languages for different language-usages (user, content,...).
6030
6080
  */
6031
- isLanguageSelectionEnabled?: boolean;
6081
+ languageSelectors?: Partial<Record<LanguageSelector, LangCode[]>>;
6032
6082
  applicationId?: string;
6033
6083
  isTivioProApp?: boolean;
6034
6084
  lockApplicationHandle?: string;
@@ -6055,6 +6105,7 @@ export declare interface TivioConfig {
6055
6105
  * customTokenCookiesDomain: 'example.com'
6056
6106
  */
6057
6107
  customTokenCookiesDomain?: string;
6108
+ enableGtmPlayerEvents?: boolean;
6058
6109
  }
6059
6110
 
6060
6111
  /**
@@ -6300,12 +6351,18 @@ export declare type TivioJsBundleExposedApi = {
6300
6351
  /**
6301
6352
  * Get tag by its id.
6302
6353
  * @param tagId - tag id
6303
- * @returns {Promise<Tag | null>} widget or null if tag does not exists
6354
+ * @returns {Promise<Tag | null>} tag or null if tag does not exists
6304
6355
  */
6305
6356
  getTagById: (tagId: string) => Promise<Tag | null>;
6357
+ /**
6358
+ * Get tags by their ids.
6359
+ * @param tagIds - tag ids
6360
+ * @returns {Promise<Tag[]} list of tags for given ids
6361
+ */
6362
+ getTagsByIds: (tagIds: string[]) => Promise<Tag[]>;
6306
6363
  createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
6307
6364
  destroy: () => Promise<void>;
6308
- } & Pick<TivioGetters, 'getVideoById' | 'getScreenById' | 'organization' | 'getUser'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow' | 'subscribeToRowsInScreen'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword' | 'resetPassword' | 'signOut'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
6365
+ } & Pick<TivioGetters, 'getVideoById' | 'getScreenById' | 'organization' | 'getUser'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow' | 'subscribeToRowsInScreen'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword' | 'resetPassword' | 'signOut'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setContentLanguage' | 'setStorageManager'>;
6309
6366
 
6310
6367
  /**
6311
6368
  * @public
@@ -6377,6 +6434,7 @@ export declare type TivioSetters = {
6377
6434
  * @param language
6378
6435
  */
6379
6436
  setLanguage: (language: LangCode) => void;
6437
+ setContentLanguage: (language: LangCode) => void;
6380
6438
  setStorageManager: (storageManager: StorageManager_2) => void;
6381
6439
  setUser: (userId: string | null, userPayload?: UserPayload) => Promise<void>;
6382
6440
  };
@@ -6405,10 +6463,6 @@ export declare type TivioSubscriptions = {
6405
6463
  subscribeToItemsInRow: SubscribeToItemsInRow;
6406
6464
  subscribeToRowsInScreen: SubscribeToRowsInScreen;
6407
6465
  subscribeToTaggedVideos: SubscribeToTaggedVideos;
6408
- registerOverlayCallbacks: (callbacks: {
6409
- onShow: () => void;
6410
- onHide: () => void;
6411
- }) => void;
6412
6466
  };
6413
6467
 
6414
6468
  /**
@@ -6624,6 +6678,10 @@ export declare type UpdateNotificationSettingsResponse = Promise<boolean>;
6624
6678
 
6625
6679
  export declare type UpsertCommentResponse = AddEditCommentResponse | DeleteCommentResponse;
6626
6680
 
6681
+ export declare type UrlNamesType = {
6682
+ [key in LangCode]?: string[];
6683
+ };
6684
+
6627
6685
  /**
6628
6686
  * @public
6629
6687
  */
@@ -7253,23 +7311,18 @@ export declare type VastApiFramework = string | 'VPAID' | null;
7253
7311
  * @public
7254
7312
  */
7255
7313
  export declare enum VastProvider {
7256
- CNC_PREBID = "cnc-prebid",
7257
7314
  CNC_STARGAZE_PREROLL_1 = "cnc-stargaze-preroll-1",
7258
7315
  CNC_STARGAZE_PREROLL_2 = "cnc-stargaze-preroll-2",
7259
7316
  CNC_STARGAZE_MIDROLL = "cnc-stargaze-midroll",
7260
- ETARGET_PREBID = "etarget-prebid",
7261
7317
  FALLBACK_HLS = "fallback-hls",
7262
7318
  FALLBACK_MP4 = "fallback",
7263
7319
  GARAZ_TV = "garaz.tv",
7264
7320
  GARAZ_TV_DEV = "garaz.tv.dev",
7265
- IMPRESSION_MEDIA_PREBID = "impressionMedia-prebid",
7266
7321
  JOJ_ADFORM = "joj",
7267
7322
  JOJ_SMART = "joj-smart",
7268
7323
  JOJ_AD_MANAGER_VOD_PREROLL = "joj-ad-manager-vod-preroll",
7269
7324
  JOJ_AD_MANAGER_VOD_MIDROLL = "joj-ad-manager-vod-midroll",
7270
7325
  JOJ_AD_MANAGER_LIVE_PREROLL = "joj-ad-manager-live-preroll",
7271
- MALL_TV = "malltv",
7272
- MALL_TV_PREBID = "malltv-prebid",
7273
7326
  PRIMA = "prima",
7274
7327
  TEST = "test",
7275
7328
  TEST_VPAID = "test-vpaid",
@@ -7381,6 +7434,7 @@ export declare interface Video extends RowItem, MonetizableItem, ReactableConten
7381
7434
  forcedCapabilities: PlayerCapability[] | null;
7382
7435
  mainLinkedVideoId?: string;
7383
7436
  getLinkedVideoIdByLanguage: (lang: LangCode) => string | undefined;
7437
+ externals?: VideoExternals;
7384
7438
  }
7385
7439
 
7386
7440
  /**
@@ -7419,6 +7473,7 @@ export declare interface VideoController {
7419
7473
  addEventListener(event: 'ad-started', callback: (value: AdMetadata & {
7420
7474
  adCtaElement: HTMLElement | null;
7421
7475
  }) => void): void;
7476
+ addEventListener(event: 'companion-ads', callback: (value: CompanionAd[]) => void): void;
7422
7477
  /**
7423
7478
  * Remove an event listener
7424
7479
  * @param event - The event name to stop listening for
@@ -7674,7 +7729,7 @@ export declare interface VideoTileSpecificData {
7674
7729
  assets?: AssetsField;
7675
7730
  episodeNumber?: number;
7676
7731
  seasonNumber?: number;
7677
- urlName?: VideoUrlNames;
7732
+ urlName?: UrlNamesType;
7678
7733
  monetizations?: VideoTileMonetizationData[];
7679
7734
  description?: Translation;
7680
7735
  }
@@ -7743,13 +7798,6 @@ export declare enum VideoType {
7743
7798
  CHILD = "CHILD"
7744
7799
  }
7745
7800
 
7746
- /**
7747
- * @public
7748
- */
7749
- export declare type VideoUrlNames = {
7750
- [key in LangCode]?: string[];
7751
- };
7752
-
7753
7801
  export declare interface ViewCountItem {
7754
7802
  /**
7755
7803
  * Unix timestamp
@@ -8196,6 +8244,10 @@ export declare interface WebConfig {
8196
8244
  * Map for all handlers
8197
8245
  */
8198
8246
  handlers?: PurchaseEventHandlers;
8247
+ homeScreen?: {
8248
+ useFullHeight?: boolean;
8249
+ };
8250
+ disableModalSwitcher?: boolean;
8199
8251
  }
8200
8252
 
8201
8253
  /**