@tivio/sdk-react 9.3.1 → 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.
- package/README.md +327 -105
- package/README.md.bak +327 -105
- package/dist/index.d.ts +92 -3
- package/dist/index.js +1 -1
- package/dist/sdk-react.d.ts +103 -3
- package/package.json +2 -2
package/dist/sdk-react.d.ts
CHANGED
@@ -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;
|
@@ -2313,6 +2333,8 @@ export declare interface InputOptions {
|
|
2313
2333
|
color?: string;
|
2314
2334
|
}
|
2315
2335
|
|
2336
|
+
export declare type InputSourceParams = SourceParams | VodExternalMultiSourceParams;
|
2337
|
+
|
2316
2338
|
export declare type IntegrationType = 'discord' | 'patreon';
|
2317
2339
|
|
2318
2340
|
export declare interface InteractiveWidget<T extends InteractiveWidgetScene = InteractiveWidgetScene> {
|
@@ -3347,6 +3369,20 @@ export declare interface PartialRegistrationOverlayContextState {
|
|
3347
3369
|
voucher?: string;
|
3348
3370
|
}
|
3349
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
|
+
|
3350
3386
|
export declare type PatreonCreatorData = {
|
3351
3387
|
campaign: string;
|
3352
3388
|
tiers: Tier[];
|
@@ -3793,6 +3829,7 @@ export declare interface PlayerSourceInterface<T extends NonAdSourceType = NonAd
|
|
3793
3829
|
start?: Date;
|
3794
3830
|
from?: Date;
|
3795
3831
|
sourceHistory?: string[];
|
3832
|
+
staticAdsConfig?: StaticAdsBreak[];
|
3796
3833
|
}
|
3797
3834
|
|
3798
3835
|
/**
|
@@ -3811,6 +3848,7 @@ export declare interface PlayerSourceParams<T extends NonAdSourceType = NonAdSou
|
|
3811
3848
|
seekingMatrix?: SeekingMatrixTemplate;
|
3812
3849
|
sessionType?: VideoSourceField['sessionType'];
|
3813
3850
|
sessionId?: string;
|
3851
|
+
staticAdsConfig?: StaticAdsBreak[];
|
3814
3852
|
}
|
3815
3853
|
|
3816
3854
|
export declare type PlayersScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.PLAYERS>;
|
@@ -3971,7 +4009,15 @@ export declare enum PlayerWrapperEvents {
|
|
3971
4009
|
/**
|
3972
4010
|
* Un-pause was triggered
|
3973
4011
|
*/
|
3974
|
-
'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"
|
3975
4021
|
}
|
3976
4022
|
|
3977
4023
|
/**
|
@@ -4231,6 +4277,11 @@ export declare type Purchase = {
|
|
4231
4277
|
voucherId: string | null;
|
4232
4278
|
isVoucherActivation?: boolean;
|
4233
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[]>;
|
4234
4285
|
};
|
4235
4286
|
|
4236
4287
|
/**
|
@@ -5662,6 +5713,21 @@ export declare interface SimplifiedVideoController {
|
|
5662
5713
|
muted: boolean;
|
5663
5714
|
volume: number;
|
5664
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;
|
5665
5731
|
/**
|
5666
5732
|
* Remove an event listener
|
5667
5733
|
* @param event - The event name to stop listening for
|
@@ -5673,6 +5739,7 @@ export declare interface SimplifiedVideoController {
|
|
5673
5739
|
* @param source - The new source to load (can be a video path, channel path, or source parameters)
|
5674
5740
|
*/
|
5675
5741
|
setSource(source: WebPlayerProps['source']): void;
|
5742
|
+
setAdsConfig(adsConfig: StaticAdsBreak[]): void;
|
5676
5743
|
/**
|
5677
5744
|
* Destroy the player and clean up all resources
|
5678
5745
|
*/
|
@@ -5792,6 +5859,19 @@ export declare interface StartLiveStreamResponse {
|
|
5792
5859
|
error?: string;
|
5793
5860
|
}
|
5794
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
|
+
|
5795
5875
|
/**
|
5796
5876
|
* @public
|
5797
5877
|
*/
|
@@ -6355,6 +6435,12 @@ export declare interface TivioConfig {
|
|
6355
6435
|
* (otherwise organizations would share login token).
|
6356
6436
|
*/
|
6357
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;
|
6358
6444
|
}
|
6359
6445
|
|
6360
6446
|
/**
|
@@ -7586,6 +7672,7 @@ export declare enum VastProvider {
|
|
7586
7672
|
TEST = "test",
|
7587
7673
|
TEST_VPAID = "test-vpaid",
|
7588
7674
|
TIVIO_ADS = "tivio-ads",
|
7675
|
+
STATIC_ADS_PROVIDER = "static-ads-provider",
|
7589
7676
|
JOJ_TEST_AD_FORM_PROGRAMMATIC = "joj-test-ad-form-programmatic",
|
7590
7677
|
JOJ_TEST_TESTER_VASTERIX = "joj-test-tester-vasterix",
|
7591
7678
|
JOJ_TEST_TESTER_ADFORM_30 = "joj-test-tester-adform-30"
|
@@ -7727,6 +7814,9 @@ export declare interface VideoController {
|
|
7727
7814
|
muted: boolean;
|
7728
7815
|
volume: number;
|
7729
7816
|
}) => void): void;
|
7817
|
+
addEventListener(event: 'ad_started', callback: (value: AdMetadata & {
|
7818
|
+
adCtaElement: HTMLElement | null;
|
7819
|
+
}) => void): void;
|
7730
7820
|
/**
|
7731
7821
|
* Remove an event listener
|
7732
7822
|
* @param event - The event name to stop listening for
|
@@ -7852,6 +7942,7 @@ export declare interface VideoController {
|
|
7852
7942
|
* @param mutations - Array of DOM mutation records
|
7853
7943
|
*/
|
7854
7944
|
onWatermarkElementChange(mutations: MutationRecord[]): void;
|
7945
|
+
setAdCtaElement: (element: HTMLElement | null) => void;
|
7855
7946
|
}
|
7856
7947
|
|
7857
7948
|
declare type VideoDetailResponsiveField = OrganizationResponsiveSetting<{
|
@@ -8096,6 +8187,14 @@ export declare interface VirtualChannelSourceParams extends ChannelSourceParams
|
|
8096
8187
|
drm?: Drm;
|
8097
8188
|
}
|
8098
8189
|
|
8190
|
+
/**
|
8191
|
+
* Interface representing the parameters for a VOD (Video On Demand) external multi-source configuration.
|
8192
|
+
* Multi-source means an array of string URLs representing the external sources for the video content.
|
8193
|
+
*/
|
8194
|
+
export declare interface VodExternalMultiSourceParams extends Omit<VodExternalSourceParams, 'url'> {
|
8195
|
+
urls: string[];
|
8196
|
+
}
|
8197
|
+
|
8099
8198
|
/**
|
8100
8199
|
* @public
|
8101
8200
|
*/
|
@@ -8448,7 +8547,7 @@ export declare interface WebGridScreenProps {
|
|
8448
8547
|
*/
|
8449
8548
|
export declare interface WebPlayerProps {
|
8450
8549
|
id: string;
|
8451
|
-
source?:
|
8550
|
+
source?: InputSourceParams | PathSourceParams | VideoPath | ChannelPath | null;
|
8452
8551
|
onEnded?: () => any;
|
8453
8552
|
/**
|
8454
8553
|
* If true, the player will inherit the width and height of its parent element.
|
@@ -8534,6 +8633,7 @@ export declare interface WebPlayerProps {
|
|
8534
8633
|
setPaymentOverlayVisible?: React_2.Dispatch<React_2.SetStateAction<boolean>>;
|
8535
8634
|
hideOverlay?: boolean;
|
8536
8635
|
sourcePlayMode?: SourcePlayMode;
|
8636
|
+
adsConfig?: StaticAdsBreak[];
|
8537
8637
|
}
|
8538
8638
|
|
8539
8639
|
/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tivio/sdk-react",
|
3
|
-
"version": "9.
|
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.
|
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",
|