@tivio/sdk-react 9.6.0 → 9.7.1

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
  */
@@ -1614,7 +1643,8 @@ export declare enum ForbiddenReason {
1614
1643
  NAME_CONTAINS_INVALID_CHAR = "NAME_CONTAINS_INVALID_CHAR",
1615
1644
  USER_ACCOUNT_LOCKED = "USER_ACCOUNT_LOCKED",
1616
1645
  USER_NOT_FOUND = "USER_NOT_FOUND",
1617
- UNSUPPORTED_BROWSER = "UNSUPPORTED_BROWSER"
1646
+ UNSUPPORTED_BROWSER = "UNSUPPORTED_BROWSER",
1647
+ ANONYMOUS_USER = "ANONYMOUS_USER"
1618
1648
  }
1619
1649
 
1620
1650
  /**
@@ -1666,9 +1696,13 @@ export declare type GeoBlocking = {
1666
1696
  blacklist: Array<any>;
1667
1697
  };
1668
1698
 
1669
- export declare interface GetArticleRequest {
1699
+ export declare type GetArticleRequest = {
1670
1700
  id: string;
1671
- }
1701
+ } | {
1702
+ idOrUrlName: string;
1703
+ organizationId: string;
1704
+ language: LangCode;
1705
+ };
1672
1706
 
1673
1707
  export declare interface GetArticleResponse {
1674
1708
  article: ArticleDocumentSerialized;
@@ -2281,12 +2315,16 @@ export declare enum LangCode {
2281
2315
  HU = "hu"
2282
2316
  }
2283
2317
 
2318
+ export declare const LangCodeToTitle: Partial<Record<LangCode, string>>;
2319
+
2284
2320
  /**
2285
2321
  * All supported languages codes as in ISO 639-1
2286
2322
  * @public
2287
2323
  */
2288
2324
  export declare const languages: LangCode[];
2289
2325
 
2326
+ export declare type LanguageSelector = 'application' | 'content';
2327
+
2290
2328
  /**
2291
2329
  * Possible language key of all supported language mutations.
2292
2330
  * @public
@@ -2335,7 +2373,13 @@ export declare interface LeaderboardsRequest {
2335
2373
  */
2336
2374
  export declare interface LinkedVideo {
2337
2375
  video: Video;
2338
- type: 'CUT' | 'TRAILER' | 'BONUS' | 'CHILD' | 'TEASER' | 'TASTING' | 'VIRTUAL_PROGRAM' | 'LANGUAGE'
2376
+ type: 'CUT' | 'TRAILER' | 'BONUS' | 'CHILD'
2377
+ /**
2378
+ * Recommendation for the video that appears ahead of
2379
+ * algorithmic recommendations on the detail page. Works one-way: if A
2380
+ * links to B, B is recommended for A only (unless B links back).
2381
+ */
2382
+ | 'RECOMMENDED' | 'TEASER' | 'TASTING' | 'VIRTUAL_PROGRAM' | 'LANGUAGE'
2339
2383
  /**
2340
2384
  * Will render separate mini-player on top of the main one, playing given video.
2341
2385
  */
@@ -2875,11 +2919,6 @@ export declare type Nullable<T> = {
2875
2919
  [P in keyof T]: T[P] | null;
2876
2920
  };
2877
2921
 
2878
- /**
2879
- * @public
2880
- */
2881
- export declare type ObjectType = Record<string, any>;
2882
-
2883
2922
  /**
2884
2923
  * @public
2885
2924
  */
@@ -3625,6 +3664,7 @@ export declare interface PlayerWrapper {
3625
3664
  isPaused: boolean;
3626
3665
  isPlaying: boolean;
3627
3666
  isIdle: boolean;
3667
+ isFullscreen: boolean;
3628
3668
  language: LangCode | null;
3629
3669
  nextRecommendedVideo: Video | null;
3630
3670
  prerollCheck: PrerollCheck;
@@ -3714,7 +3754,11 @@ export declare enum PlayerWrapperEvents {
3714
3754
  /**
3715
3755
  * Triggered when an ad finishes playing
3716
3756
  */
3717
- 'ad-ended' = "ad-ended"
3757
+ 'ad-ended' = "ad-ended",
3758
+ /**
3759
+ * Triggered when companion ads are available for the current ad
3760
+ */
3761
+ 'companion-ads' = "companion-ads"
3718
3762
  }
3719
3763
 
3720
3764
  /**
@@ -5424,6 +5468,12 @@ export declare interface SimplifiedVideoController {
5424
5468
  * @param callback - Function called when an ad finishes playing
5425
5469
  */
5426
5470
  addEventListener(event: 'ad-ended', callback: () => void): void;
5471
+ /**
5472
+ * Add an event listener for companion ads events
5473
+ * @param event - Must be 'companion-ads'
5474
+ * @param callback - Function called when companion ads are available
5475
+ */
5476
+ addEventListener(event: 'companion-ads', callback: (companionAds: CompanionAd[]) => void): void;
5427
5477
  /**
5428
5478
  * Remove an event listener
5429
5479
  * @param event - The event name to stop listening for
@@ -5555,7 +5605,7 @@ export declare interface StartLiveStreamResponse {
5555
5605
  error?: string;
5556
5606
  }
5557
5607
 
5558
- export declare type StaticAdsBreak = StaticAdsBreakPostrollPreroll | StaticAdsBreakMidroll;
5608
+ export declare type StaticAdsBreak = StaticAdsBreakPostrollPreroll | StaticAdsBreakMidroll | StaticAdsBreakReplacement;
5559
5609
 
5560
5610
  export declare interface StaticAdsBreakMidroll {
5561
5611
  type: 'midroll';
@@ -5568,6 +5618,11 @@ declare interface StaticAdsBreakPostrollPreroll {
5568
5618
  url: string;
5569
5619
  }
5570
5620
 
5621
+ export declare interface StaticAdsBreakReplacement {
5622
+ type: 'replacement';
5623
+ url: string;
5624
+ }
5625
+
5571
5626
  /**
5572
5627
  * @public
5573
5628
  */
@@ -6012,7 +6067,7 @@ export declare interface TivioConfig {
6012
6067
  };
6013
6068
  secret: string;
6014
6069
  /**
6015
- * Language used when isLanguageSelectionEnabled is false | undefined or when not possible to load language from local storage or localization worker
6070
+ * Language used when no languageSelector is set or when not possible to load language from local storage or localization worker
6016
6071
  */
6017
6072
  language: LangCode;
6018
6073
  debug?: boolean;
@@ -6020,15 +6075,16 @@ export declare interface TivioConfig {
6020
6075
  firebaseApp?: any | null;
6021
6076
  firebaseFactory?: (config: object, appName?: string) => firebase_2.FirebaseApp;
6022
6077
  authDomainOverride?: string;
6078
+ /**
6079
+ * @deprecated this field is no longer in use and has no impact when set.
6080
+ */
6023
6081
  firestore?: any | null;
6024
6082
  currency: Currency;
6025
6083
  /**
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
6084
+ * Represents an optional array of LanguageSelector objects.
6085
+ * Used to define and manage a list of supported languages for different language-usages (user, content,...).
6030
6086
  */
6031
- isLanguageSelectionEnabled?: boolean;
6087
+ languageSelectors?: Partial<Record<LanguageSelector, LangCode[]>>;
6032
6088
  applicationId?: string;
6033
6089
  isTivioProApp?: boolean;
6034
6090
  lockApplicationHandle?: string;
@@ -6055,6 +6111,7 @@ export declare interface TivioConfig {
6055
6111
  * customTokenCookiesDomain: 'example.com'
6056
6112
  */
6057
6113
  customTokenCookiesDomain?: string;
6114
+ enableGtmPlayerEvents?: boolean;
6058
6115
  }
6059
6116
 
6060
6117
  /**
@@ -6300,12 +6357,18 @@ export declare type TivioJsBundleExposedApi = {
6300
6357
  /**
6301
6358
  * Get tag by its id.
6302
6359
  * @param tagId - tag id
6303
- * @returns {Promise<Tag | null>} widget or null if tag does not exists
6360
+ * @returns {Promise<Tag | null>} tag or null if tag does not exists
6304
6361
  */
6305
6362
  getTagById: (tagId: string) => Promise<Tag | null>;
6363
+ /**
6364
+ * Get tags by their ids.
6365
+ * @param tagIds - tag ids
6366
+ * @returns {Promise<Tag[]} list of tags for given ids
6367
+ */
6368
+ getTagsByIds: (tagIds: string[]) => Promise<Tag[]>;
6306
6369
  createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
6307
6370
  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'>;
6371
+ } & 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
6372
 
6310
6373
  /**
6311
6374
  * @public
@@ -6377,6 +6440,7 @@ export declare type TivioSetters = {
6377
6440
  * @param language
6378
6441
  */
6379
6442
  setLanguage: (language: LangCode) => void;
6443
+ setContentLanguage: (language: LangCode) => void;
6380
6444
  setStorageManager: (storageManager: StorageManager_2) => void;
6381
6445
  setUser: (userId: string | null, userPayload?: UserPayload) => Promise<void>;
6382
6446
  };
@@ -6405,10 +6469,6 @@ export declare type TivioSubscriptions = {
6405
6469
  subscribeToItemsInRow: SubscribeToItemsInRow;
6406
6470
  subscribeToRowsInScreen: SubscribeToRowsInScreen;
6407
6471
  subscribeToTaggedVideos: SubscribeToTaggedVideos;
6408
- registerOverlayCallbacks: (callbacks: {
6409
- onShow: () => void;
6410
- onHide: () => void;
6411
- }) => void;
6412
6472
  };
6413
6473
 
6414
6474
  /**
@@ -6624,6 +6684,10 @@ export declare type UpdateNotificationSettingsResponse = Promise<boolean>;
6624
6684
 
6625
6685
  export declare type UpsertCommentResponse = AddEditCommentResponse | DeleteCommentResponse;
6626
6686
 
6687
+ export declare type UrlNamesType = {
6688
+ [key in LangCode]?: string[];
6689
+ };
6690
+
6627
6691
  /**
6628
6692
  * @public
6629
6693
  */
@@ -7253,23 +7317,18 @@ export declare type VastApiFramework = string | 'VPAID' | null;
7253
7317
  * @public
7254
7318
  */
7255
7319
  export declare enum VastProvider {
7256
- CNC_PREBID = "cnc-prebid",
7257
7320
  CNC_STARGAZE_PREROLL_1 = "cnc-stargaze-preroll-1",
7258
7321
  CNC_STARGAZE_PREROLL_2 = "cnc-stargaze-preroll-2",
7259
7322
  CNC_STARGAZE_MIDROLL = "cnc-stargaze-midroll",
7260
- ETARGET_PREBID = "etarget-prebid",
7261
7323
  FALLBACK_HLS = "fallback-hls",
7262
7324
  FALLBACK_MP4 = "fallback",
7263
7325
  GARAZ_TV = "garaz.tv",
7264
7326
  GARAZ_TV_DEV = "garaz.tv.dev",
7265
- IMPRESSION_MEDIA_PREBID = "impressionMedia-prebid",
7266
7327
  JOJ_ADFORM = "joj",
7267
7328
  JOJ_SMART = "joj-smart",
7268
7329
  JOJ_AD_MANAGER_VOD_PREROLL = "joj-ad-manager-vod-preroll",
7269
7330
  JOJ_AD_MANAGER_VOD_MIDROLL = "joj-ad-manager-vod-midroll",
7270
7331
  JOJ_AD_MANAGER_LIVE_PREROLL = "joj-ad-manager-live-preroll",
7271
- MALL_TV = "malltv",
7272
- MALL_TV_PREBID = "malltv-prebid",
7273
7332
  PRIMA = "prima",
7274
7333
  TEST = "test",
7275
7334
  TEST_VPAID = "test-vpaid",
@@ -7381,6 +7440,7 @@ export declare interface Video extends RowItem, MonetizableItem, ReactableConten
7381
7440
  forcedCapabilities: PlayerCapability[] | null;
7382
7441
  mainLinkedVideoId?: string;
7383
7442
  getLinkedVideoIdByLanguage: (lang: LangCode) => string | undefined;
7443
+ externals?: VideoExternals;
7384
7444
  }
7385
7445
 
7386
7446
  /**
@@ -7419,6 +7479,7 @@ export declare interface VideoController {
7419
7479
  addEventListener(event: 'ad-started', callback: (value: AdMetadata & {
7420
7480
  adCtaElement: HTMLElement | null;
7421
7481
  }) => void): void;
7482
+ addEventListener(event: 'companion-ads', callback: (value: CompanionAd[]) => void): void;
7422
7483
  /**
7423
7484
  * Remove an event listener
7424
7485
  * @param event - The event name to stop listening for
@@ -7674,7 +7735,7 @@ export declare interface VideoTileSpecificData {
7674
7735
  assets?: AssetsField;
7675
7736
  episodeNumber?: number;
7676
7737
  seasonNumber?: number;
7677
- urlName?: VideoUrlNames;
7738
+ urlName?: UrlNamesType;
7678
7739
  monetizations?: VideoTileMonetizationData[];
7679
7740
  description?: Translation;
7680
7741
  }
@@ -7743,13 +7804,6 @@ export declare enum VideoType {
7743
7804
  CHILD = "CHILD"
7744
7805
  }
7745
7806
 
7746
- /**
7747
- * @public
7748
- */
7749
- export declare type VideoUrlNames = {
7750
- [key in LangCode]?: string[];
7751
- };
7752
-
7753
7807
  export declare interface ViewCountItem {
7754
7808
  /**
7755
7809
  * Unix timestamp
@@ -8196,6 +8250,10 @@ export declare interface WebConfig {
8196
8250
  * Map for all handlers
8197
8251
  */
8198
8252
  handlers?: PurchaseEventHandlers;
8253
+ homeScreen?: {
8254
+ useFullHeight?: boolean;
8255
+ };
8256
+ disableModalSwitcher?: boolean;
8199
8257
  }
8200
8258
 
8201
8259
  /**