@tivio/sdk-react 9.7.0 → 9.8.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.
@@ -104,6 +104,7 @@ export declare type AdMetadata = {
104
104
  isSkippable: boolean;
105
105
  order: number | null;
106
106
  totalCount: number | null;
107
+ adPlacementStrategy: AdPlacementStrategy;
107
108
  customAdMetadata?: Record<string, unknown>;
108
109
  skip: () => void;
109
110
  } | null;
@@ -118,7 +119,10 @@ export declare interface AdPackInfo {
118
119
  total: number;
119
120
  }
120
121
 
122
+ export declare type AdPlacementStrategy = 'preroll' | 'midroll' | 'postroll' | 'replacement';
123
+
121
124
  export declare interface AdSegment {
125
+ adPlacementStrategy: AdPlacementStrategy;
122
126
  id: string;
123
127
  /**
124
128
  * @deprecated alias to secondsToEnd * 1000
@@ -183,6 +187,7 @@ export declare interface AdSourceActions {
183
187
  */
184
188
  export declare interface AdSourceInterface extends CommonSourceInterface<SourceType.ADVERTISEMENT> {
185
189
  adType: AdType;
190
+ adPlacementStrategy: AdPlacementStrategy;
186
191
  durationMs: number;
187
192
  skipDelayMs: number | null;
188
193
  /**
@@ -233,6 +238,7 @@ export declare interface AdSourceInterface extends CommonSourceInterface<SourceT
233
238
  */
234
239
  export declare interface AdSourceParams extends CommonSourceParams<SourceType.ADVERTISEMENT> {
235
240
  id: string;
241
+ adPlacementStrategy: AdPlacementStrategy;
236
242
  adType?: AdType;
237
243
  actions?: AdSourceActions | null;
238
244
  apiFramework?: VastApiFramework | null;
@@ -761,6 +767,7 @@ export declare interface ChannelSourceInterface extends PlayerSourceInterface<So
761
767
  to: Date;
762
768
  poster: string | null;
763
769
  tvMode: TvMode | 'live' | null;
770
+ clone: (params?: Partial<ChannelSourceParams>) => ChannelSourceInterface;
764
771
  }
765
772
 
766
773
  /**
@@ -1603,6 +1610,9 @@ export declare interface DidomiWindow {
1603
1610
  * https://developers.didomi.io/cmp/web-sdk/reference/api
1604
1611
  */
1605
1612
  didomiOnReady: (() => void)[];
1613
+ Didomi?: {
1614
+ getUserConsentStatusForPurpose: (category: string) => boolean;
1615
+ };
1606
1616
  }
1607
1617
 
1608
1618
  /**
@@ -1927,7 +1937,8 @@ export declare enum ForbiddenReason {
1927
1937
  NAME_CONTAINS_INVALID_CHAR = "NAME_CONTAINS_INVALID_CHAR",
1928
1938
  USER_ACCOUNT_LOCKED = "USER_ACCOUNT_LOCKED",
1929
1939
  USER_NOT_FOUND = "USER_NOT_FOUND",
1930
- UNSUPPORTED_BROWSER = "UNSUPPORTED_BROWSER"
1940
+ UNSUPPORTED_BROWSER = "UNSUPPORTED_BROWSER",
1941
+ ANONYMOUS_USER = "ANONYMOUS_USER"
1931
1942
  }
1932
1943
 
1933
1944
  /**
@@ -2153,6 +2164,10 @@ export declare interface GetSourceUrlResponse {
2153
2164
  * Determines session type generated for source. If no provided it will be considered 'ondemand' session type.
2154
2165
  */
2155
2166
  sessionType?: VideoSourceField['sessionType'];
2167
+ /**
2168
+ * Language of the source.
2169
+ */
2170
+ language?: LangCode;
2156
2171
  }
2157
2172
 
2158
2173
  export declare type GetTilesInRowResponse<U extends NextPageParamType = NextPageParamType> = PaginatedResponse<TileData, U>;
@@ -3581,6 +3596,11 @@ export declare type PlayerConfig = {
3581
3596
  */
3582
3597
  name: 'IMA SDK' | 'TIVIO AD SERVICE';
3583
3598
  };
3599
+ /**
3600
+ * If true, then TV channels are not available for anonymous users and they will be shown an overlay to sign in.
3601
+ * @default false
3602
+ */
3603
+ disableTvChannelsForAnonymousUsers?: boolean;
3584
3604
  };
3585
3605
 
3586
3606
  /**
@@ -3704,6 +3724,11 @@ export declare interface PlayerEngineInterface {
3704
3724
  */
3705
3725
  setPlaysInline(value: boolean): void;
3706
3726
  setControlsList(value: string[]): void;
3727
+ /** Gets resolution of the video element in pixels - container size, not the actual source quality resolution */
3728
+ getVideoResolution(): {
3729
+ width: number;
3730
+ height: number;
3731
+ };
3707
3732
  }
3708
3733
 
3709
3734
  /**
@@ -3799,6 +3824,11 @@ export declare interface PlayerInterface {
3799
3824
  */
3800
3825
  setPlaysInline?: (value: boolean) => void;
3801
3826
  setControlsList?: (value: string[]) => void;
3827
+ /** Gets resolution of the video element in pixels - container size, not the actual source quality resolution */
3828
+ getVideoResolution(): {
3829
+ width: number;
3830
+ height: number;
3831
+ };
3802
3832
  }
3803
3833
 
3804
3834
  /**
@@ -3901,6 +3931,13 @@ export declare type PlayerState = 'idle' | 'playing' | 'paused';
3901
3931
  * @public
3902
3932
  */
3903
3933
  export declare interface PlayerWrapper {
3934
+ /**
3935
+ * Unique id of the player wrapper instance, set at construction time
3936
+ * (e.g. by `tivio.getPlayerWrapper(id)`). Used to scope DOM ids of
3937
+ * player-owned elements (IMA ad containers, content video element, …)
3938
+ * so multiple players on the same page don't collide.
3939
+ */
3940
+ readonly id: string;
3904
3941
  /**
3905
3942
  * Report that playback of video has finished
3906
3943
  */
@@ -4005,6 +4042,10 @@ export declare interface PlayerWrapper {
4005
4042
  setCanPlay: (canPlay: boolean) => void;
4006
4043
  toggleMuted: () => void;
4007
4044
  getQualities: () => Track[];
4045
+ getVideoResolution: () => {
4046
+ width: number;
4047
+ height: number;
4048
+ };
4008
4049
  playNativeImaAd: (url: string) => void;
4009
4050
  playSourceAfterAdsRun: () => void;
4010
4051
  putAd: (ad: AdSourceInterface) => void;
@@ -5798,6 +5839,18 @@ export declare interface SimplifiedVideoController {
5798
5839
  */
5799
5840
  setSource(source: WebPlayerProps['source']): void;
5800
5841
  setAdsConfig(adsConfig: StaticAdsBreak[]): void;
5842
+ /**
5843
+ * Toggle the minimal OSD mode.
5844
+ *
5845
+ * When enabled, the player shows only a minimal set of controls (play/pause,
5846
+ * volume and fullscreen) and a small center play/pause icon that briefly
5847
+ * flashes when the state changes. Intended for small/pinned containers such
5848
+ * as a scroll-fixed mini player in the corner of the page or a full-width
5849
+ * mobile player pinned to the top of the viewport.
5850
+ *
5851
+ * @param isMinimal - Whether the minimal OSD should be used
5852
+ */
5853
+ setIsMinimal(isMinimal: boolean): void;
5801
5854
  /**
5802
5855
  * Destroy the player and clean up all resources
5803
5856
  */
@@ -5917,7 +5970,7 @@ export declare interface StartLiveStreamResponse {
5917
5970
  error?: string;
5918
5971
  }
5919
5972
 
5920
- export declare type StaticAdsBreak = StaticAdsBreakPostrollPreroll | StaticAdsBreakMidroll;
5973
+ export declare type StaticAdsBreak = StaticAdsBreakPostrollPreroll | StaticAdsBreakMidroll | StaticAdsBreakReplacement;
5921
5974
 
5922
5975
  export declare interface StaticAdsBreakMidroll {
5923
5976
  type: 'midroll';
@@ -5930,6 +5983,11 @@ declare interface StaticAdsBreakPostrollPreroll {
5930
5983
  url: string;
5931
5984
  }
5932
5985
 
5986
+ export declare interface StaticAdsBreakReplacement {
5987
+ type: 'replacement';
5988
+ url: string;
5989
+ }
5990
+
5933
5991
  /**
5934
5992
  * @public
5935
5993
  */
@@ -6828,6 +6886,8 @@ export declare type TivioReactBundle = {
6828
6886
  */
6829
6887
  internal: TivioInternalBundle;
6830
6888
  analytics: TivioAnalytics;
6889
+ addToFavoritesByPath: (path: string) => Promise<void>;
6890
+ removeFromFavoritesByPath: (path: string) => Promise<void>;
6831
6891
  destroy: () => Promise<void>;
6832
6892
  } & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'> & Omit<Partial<TivioJsBundleExposedApi>, 'createPlayerWrapper'>;
6833
6893
 
@@ -8227,7 +8287,7 @@ export declare interface ViewCountItem {
8227
8287
  /**
8228
8288
  * @public
8229
8289
  */
8230
- export declare interface VirtualChannelSourceInterface extends ChannelSourceInterface {
8290
+ export declare interface VirtualChannelSourceInterface extends Omit<ChannelSourceInterface, 'clone'> {
8231
8291
  tvChannelType: TvChannelType.VIRTUAL;
8232
8292
  program?: TvProgram | null;
8233
8293
  video?: Video | null;
@@ -8737,6 +8797,14 @@ export declare interface WebPlayerProps {
8737
8797
  * If true then OSD is shown based on condition resolved in HidableOsdContainer, e.g. on pause, on mouse move etc.
8738
8798
  */
8739
8799
  showOsd?: boolean;
8800
+ /**
8801
+ * If true, then only a minimal set of OSD controls is shown (play/pause, volume, fullscreen)
8802
+ * and the big center play/pause button only flashes briefly on state change.
8803
+ *
8804
+ * Intended for small fixed containers (e.g. a scroll-pinned mini player in the corner
8805
+ * of the page, or a full-width mobile player pinned to the top of the viewport).
8806
+ */
8807
+ isMinimal?: boolean;
8740
8808
  /**
8741
8809
  * If false, then buffering spinner is never shown.
8742
8810
  * If true then buffering spinner is shown while buffering.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tivio/sdk-react",
3
- "version": "9.7.0",
3
+ "version": "9.8.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.138",
41
+ "@tivio/common": "1.1.144",
42
42
  "dayjs": "^1.11.0",
43
43
  "es7-object-polyfill": "^1.0.1",
44
44
  "firebase": "8.10.1",