@tivio/sdk-react 3.6.3 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +47 -0
- package/README.md.bak +47 -0
- package/dist/index.d.ts +566 -343
- package/dist/index.js +1 -1
- package/dist/sdk-react.d.ts +608 -346
- package/package.json +2 -2
- package/doc/changelog.md +0 -0
package/dist/index.d.ts
CHANGED
@@ -37,6 +37,27 @@ export declare interface AdExternal {
|
|
37
37
|
skip: () => void;
|
38
38
|
}
|
39
39
|
|
40
|
+
/**
|
41
|
+
* @public
|
42
|
+
*/
|
43
|
+
export declare type AdMetadata = {
|
44
|
+
type: 'ad';
|
45
|
+
subType: 'inserted' | 'original';
|
46
|
+
secondsToEnd: number;
|
47
|
+
/**
|
48
|
+
* null when ad is not skippable
|
49
|
+
*/
|
50
|
+
secondsToSkippable: number | null;
|
51
|
+
canTriggerSkip: boolean;
|
52
|
+
isSkippable: boolean;
|
53
|
+
order: number | null;
|
54
|
+
totalCount: number | null;
|
55
|
+
skip: () => void;
|
56
|
+
} | null;
|
57
|
+
|
58
|
+
/**
|
59
|
+
* @public
|
60
|
+
*/
|
40
61
|
declare type AdSegment = {
|
41
62
|
id: string;
|
42
63
|
/**
|
@@ -95,6 +116,13 @@ export declare type AdSource = {
|
|
95
116
|
secondsToSkippable: number | null;
|
96
117
|
};
|
97
118
|
|
119
|
+
/**
|
120
|
+
* @public
|
121
|
+
*/
|
122
|
+
declare type AdSource_2 = SourceBase & {
|
123
|
+
type: 'ad';
|
124
|
+
};
|
125
|
+
|
98
126
|
/**
|
99
127
|
* @public
|
100
128
|
*/
|
@@ -106,6 +134,14 @@ export declare enum ALGOLIA_INDEX_NAME {
|
|
106
134
|
USERS = "users"
|
107
135
|
}
|
108
136
|
|
137
|
+
/**
|
138
|
+
* @public
|
139
|
+
*/
|
140
|
+
export declare type ArrisDeviceInfo = {
|
141
|
+
type: 'arris';
|
142
|
+
model?: 'VIP1003' | 'VIP1113' | 'VIP5305';
|
143
|
+
};
|
144
|
+
|
109
145
|
/**
|
110
146
|
* @public
|
111
147
|
*/
|
@@ -185,11 +221,7 @@ export declare type BannerProps = {
|
|
185
221
|
hoverable: boolean;
|
186
222
|
broadcastInfo: string;
|
187
223
|
height: number;
|
188
|
-
coverPadding: CoverPadding;
|
189
224
|
cover: string;
|
190
|
-
fullWidth: boolean;
|
191
|
-
coverContainerPaddingTop: string;
|
192
|
-
width: number;
|
193
225
|
overlay: boolean;
|
194
226
|
price: string;
|
195
227
|
hasRoundCorners: boolean;
|
@@ -202,39 +234,6 @@ export declare type BannerProps = {
|
|
202
234
|
*/
|
203
235
|
export declare type BannerPropsPartial = Partial<BannerProps>;
|
204
236
|
|
205
|
-
/**
|
206
|
-
* @public
|
207
|
-
*/
|
208
|
-
export declare type BasicTivioBundle = {
|
209
|
-
components: TivioComponents;
|
210
|
-
getters: TivioGetters;
|
211
|
-
auth: TivioAuth;
|
212
|
-
hooks: TivioHooks;
|
213
|
-
sources: TivioSources;
|
214
|
-
subscriptions: TivioSubscriptions;
|
215
|
-
purchaseVideoWithQerko: (videoId: string, monetizationId: string, voucher?: {
|
216
|
-
expirationDate: Date;
|
217
|
-
}) => Promise<QerkoPaymentInfo>;
|
218
|
-
purchaseSubscriptionWithQerko: (monetizationId: string, voucher?: {
|
219
|
-
expirationDate: Date;
|
220
|
-
}) => Promise<QerkoPaymentInfo>;
|
221
|
-
cancelSubscriptionWithQerko: (subscriptionId: string) => Promise<QerkoCancellationInfo>;
|
222
|
-
/**
|
223
|
-
* Set tivio language.
|
224
|
-
* @param language
|
225
|
-
*/
|
226
|
-
setLanguage: (language: LangCode) => void;
|
227
|
-
setUser: (userId: string | null, userPayload?: UserPayload) => Promise<void>;
|
228
|
-
showConsentPreferences: () => void;
|
229
|
-
/**
|
230
|
-
* Contains hooks and providers for internal usages.
|
231
|
-
* They used in our apps, e.g. web, or in sdk-react (e.g. some sdk hooks are just wrappers for core-react-dom hooks)
|
232
|
-
* TODO should not be the part of public API
|
233
|
-
*/
|
234
|
-
internal: TivioInternalBundle;
|
235
|
-
destroy: () => Promise<void>;
|
236
|
-
};
|
237
|
-
|
238
237
|
/**
|
239
238
|
* @public
|
240
239
|
*/
|
@@ -260,7 +259,7 @@ export declare const bundlePromise: Promise<RemoteBundleState>;
|
|
260
259
|
/**
|
261
260
|
* @public
|
262
261
|
*/
|
263
|
-
export declare type Callback = () => void;
|
262
|
+
export declare type Callback<T = any> = (arg?: T) => void;
|
264
263
|
|
265
264
|
/**
|
266
265
|
* @public
|
@@ -273,14 +272,6 @@ export declare interface Channel {
|
|
273
272
|
recentVideos: Video[];
|
274
273
|
}
|
275
274
|
|
276
|
-
/**
|
277
|
-
* @public
|
278
|
-
*/
|
279
|
-
export declare const ChannelsContext: React_2.Context<DataState<Channel>>;
|
280
|
-
|
281
|
-
/**
|
282
|
-
* @public
|
283
|
-
*/
|
284
275
|
export declare type ChannelSource = {
|
285
276
|
new (uri: string, originalOptions: Record<string, any>, channelName: string, programName: string, programDescription: string, from: Date, to: Date): ChannelSource;
|
286
277
|
description: string;
|
@@ -318,14 +309,13 @@ export declare type Chapter = any;
|
|
318
309
|
/**
|
319
310
|
* @public
|
320
311
|
*/
|
321
|
-
export declare type
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
};
|
312
|
+
export declare type CmpConfig = 'default' | 'debug' | 'none';
|
313
|
+
|
314
|
+
/**
|
315
|
+
* Just another alias. Reexported for backward compatibility.
|
316
|
+
* @public
|
317
|
+
*/
|
318
|
+
export declare type Config = SdkReactConfig;
|
329
319
|
|
330
320
|
/**
|
331
321
|
* @public
|
@@ -381,13 +371,6 @@ export declare enum CUSTOMER_BUILD {
|
|
381
371
|
INVESTOREES = "INVESTOREES"
|
382
372
|
}
|
383
373
|
|
384
|
-
declare interface DataState<T> {
|
385
|
-
data: {
|
386
|
-
[key: string]: HookData<T>;
|
387
|
-
};
|
388
|
-
setData: (key: string, data: HookData<T>) => void;
|
389
|
-
}
|
390
|
-
|
391
374
|
/**
|
392
375
|
* @public
|
393
376
|
*/
|
@@ -410,6 +393,11 @@ export declare type DetailedPrice = {
|
|
410
393
|
frequency?: MONETIZATION_FREQUENCY;
|
411
394
|
};
|
412
395
|
|
396
|
+
/**
|
397
|
+
* @public
|
398
|
+
*/
|
399
|
+
export declare type DeviceInfo = ArrisDeviceInfo | ReactNativeDeviceInfo;
|
400
|
+
|
413
401
|
/**
|
414
402
|
* @public
|
415
403
|
*/
|
@@ -441,6 +429,11 @@ export declare type DocumentOptions = Partial<{
|
|
441
429
|
*/
|
442
430
|
export declare type Empty = void | Promise<void> | undefined | Promise<undefined>;
|
443
431
|
|
432
|
+
/**
|
433
|
+
* @public
|
434
|
+
*/
|
435
|
+
declare type Empty_2 = void | Promise<void> | undefined | Promise<undefined>;
|
436
|
+
|
444
437
|
/**
|
445
438
|
* @public
|
446
439
|
*/
|
@@ -483,12 +476,6 @@ export declare interface GenericOnCallError {
|
|
483
476
|
*/
|
484
477
|
export declare const getPubSub: () => PubSub;
|
485
478
|
|
486
|
-
declare interface HookData<T> {
|
487
|
-
data: PaginationData<T> | null;
|
488
|
-
error: Error | null;
|
489
|
-
isLoading: boolean;
|
490
|
-
}
|
491
|
-
|
492
479
|
/**
|
493
480
|
* @public
|
494
481
|
*/
|
@@ -556,46 +543,23 @@ export declare type InputSource = AdSource | ChannelSource | VodTivioSource | Vo
|
|
556
543
|
/**
|
557
544
|
* @public
|
558
545
|
*/
|
559
|
-
export declare type InternalConfig = {
|
560
|
-
/**
|
561
|
-
* @private URL of remote code bundle to be fetched directly (without using resolver)
|
562
|
-
*/
|
563
|
-
bundleUrlOverride?: string;
|
564
|
-
/**
|
565
|
-
* Tells Tivio which technologies/protocols etc. is the device capable to play.
|
566
|
-
* If not provided, Tivio will try to guess it (based on the browser).
|
567
|
-
*/
|
568
|
-
deviceCapabilities: PlayerCapability[];
|
569
|
-
/**
|
570
|
-
* Additional options for deviceCapabilities
|
571
|
-
*/
|
572
|
-
capabilitiesOptions?: {
|
573
|
-
/**
|
574
|
-
* Should the player prefer HTTP sources instead HTTPs if they are available.
|
575
|
-
* This can be used on platforms that support mixed content but do not support
|
576
|
-
* specific HTTPS certificates. (e.g. certificates from Letsencrypt not supported on LG TVs)
|
577
|
-
*/
|
578
|
-
preferHttp?: boolean;
|
579
|
-
};
|
580
|
-
secret: string | null;
|
581
|
-
language?: LangCode;
|
582
|
-
verbose?: boolean;
|
583
|
-
currency: Currency;
|
584
|
-
disableUnmounting?: boolean;
|
585
|
-
enable?: boolean;
|
586
|
-
enableSentry?: boolean;
|
587
|
-
ErrorComponent?: ComponentType<{
|
588
|
-
error: string | null;
|
589
|
-
}>;
|
546
|
+
export declare type InternalConfig = SdkReactConfig & {
|
590
547
|
fetchPackage: FetchPackage;
|
591
|
-
LoaderComponent?: ComponentType;
|
592
|
-
logger?: Logger | null;
|
593
548
|
pubSub: PubSub;
|
594
549
|
/**
|
595
|
-
* @private URL of resolver. Resolver is a script used to fetch
|
550
|
+
* @private URL of resolver. Resolver is a script used to fetch remote code bundle
|
596
551
|
*/
|
597
552
|
resolverUrl: string;
|
598
553
|
sdkVersion: string;
|
554
|
+
/**
|
555
|
+
* @private URL of remote code bundle to be fetched directly (without using resolver)
|
556
|
+
*/
|
557
|
+
bundleUrlOverride?: string;
|
558
|
+
/**
|
559
|
+
* @private
|
560
|
+
* Run HTML, CSS and JS feature support check
|
561
|
+
*/
|
562
|
+
runFeatureSupportCheck?: boolean;
|
599
563
|
/**
|
600
564
|
* @private
|
601
565
|
*/
|
@@ -620,6 +584,24 @@ declare interface IntroMarker {
|
|
620
584
|
*/
|
621
585
|
export declare type ItemsInRow = Tag | Video | TvChannel;
|
622
586
|
|
587
|
+
/**
|
588
|
+
* @public
|
589
|
+
*/
|
590
|
+
export declare interface JojExternals {
|
591
|
+
tvProfiProgramId?: string;
|
592
|
+
tvProfiContentId?: string;
|
593
|
+
tvProfiSerialId?: string;
|
594
|
+
contentId?: string;
|
595
|
+
provysId?: string;
|
596
|
+
tvProfiProvysId?: string;
|
597
|
+
tvProfiHouseId?: string;
|
598
|
+
tvProfiTitleOriginal?: string;
|
599
|
+
tvProfiTitleSk?: string;
|
600
|
+
tvProfiType?: string;
|
601
|
+
tvProfiSeriesName?: string;
|
602
|
+
tvProfiDistributor?: string;
|
603
|
+
}
|
604
|
+
|
623
605
|
/**
|
624
606
|
* Enum of all supported languages codes as in ISO 639-1
|
625
607
|
* @public
|
@@ -654,6 +636,34 @@ export declare type LinkedVideo = {
|
|
654
636
|
type: 'CUT' | 'TRAILER' | 'BONUS' | 'CHILD';
|
655
637
|
};
|
656
638
|
|
639
|
+
/**
|
640
|
+
* @public
|
641
|
+
*/
|
642
|
+
export declare type Listener = ListenerAdMetadata | ListenerMarkers;
|
643
|
+
|
644
|
+
/**
|
645
|
+
* @public
|
646
|
+
*/
|
647
|
+
export declare type ListenerAdMetadata = (metadata: AdMetadata) => void;
|
648
|
+
|
649
|
+
/**
|
650
|
+
* @public
|
651
|
+
*/
|
652
|
+
export declare type ListenerMarkers = (marker: Marker[] | null) => void;
|
653
|
+
|
654
|
+
/**
|
655
|
+
* Not supported yet, now it does pass-through only.
|
656
|
+
*
|
657
|
+
* @public
|
658
|
+
*/
|
659
|
+
export declare type LiveTvChannelSource = SourceBase & {
|
660
|
+
type: 'live_tv_channel';
|
661
|
+
/**
|
662
|
+
* Tivio needs channel name in order to load markers.
|
663
|
+
*/
|
664
|
+
channelName: string;
|
665
|
+
};
|
666
|
+
|
657
667
|
declare interface Logger {
|
658
668
|
/** important messages */
|
659
669
|
warn(...data: LoggerArgs): void;
|
@@ -676,15 +686,24 @@ declare type LoggerArgs = any[];
|
|
676
686
|
/**
|
677
687
|
* @public
|
678
688
|
*/
|
679
|
-
export declare
|
689
|
+
export declare interface MallTvExternals {
|
690
|
+
mallTvEntityId: string;
|
691
|
+
}
|
692
|
+
|
693
|
+
/**
|
694
|
+
* @public
|
695
|
+
*/
|
696
|
+
export declare interface Marker {
|
680
697
|
id: string;
|
681
|
-
type: string;
|
682
698
|
from: Date;
|
683
699
|
to: Date;
|
684
700
|
count?: number;
|
685
701
|
fromMs?: number;
|
686
702
|
toMs?: number;
|
687
|
-
|
703
|
+
relativeFromMs: number;
|
704
|
+
relativeToMs: number;
|
705
|
+
type: 'AD' | 'AD_SEGMENT' | 'START' | 'END' | 'INTRO';
|
706
|
+
}
|
688
707
|
|
689
708
|
/**
|
690
709
|
* @public
|
@@ -740,6 +759,16 @@ export declare type Nullable<T> = {
|
|
740
759
|
*/
|
741
760
|
export declare type ObjectType = Record<string, any>;
|
742
761
|
|
762
|
+
/**
|
763
|
+
* @public
|
764
|
+
*/
|
765
|
+
export declare interface OktagonExternals {
|
766
|
+
/**
|
767
|
+
* DRM content Key ID - shouldn't be more connected with buyDRM or streamOnline? It is not general thing
|
768
|
+
*/
|
769
|
+
keyId?: string;
|
770
|
+
}
|
771
|
+
|
743
772
|
/**
|
744
773
|
* @public
|
745
774
|
*/
|
@@ -756,10 +785,14 @@ declare type OrderByDirection = 'desc' | 'asc';
|
|
756
785
|
export declare interface Organization {
|
757
786
|
}
|
758
787
|
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
788
|
+
/**
|
789
|
+
* If Tivio PlayerWrapper is an interception layer, it should allow the pass-through
|
790
|
+
* of not just Tivio source types but any other source types that the 3rd party app may be using.
|
791
|
+
*
|
792
|
+
* @public
|
793
|
+
*/
|
794
|
+
export declare type OtherSource = SourceBase & StartAndContinuePosition & {
|
795
|
+
type: 'other';
|
763
796
|
};
|
764
797
|
|
765
798
|
/**
|
@@ -789,6 +822,30 @@ export declare enum PLATFORM {
|
|
789
822
|
TV = "TV"
|
790
823
|
}
|
791
824
|
|
825
|
+
/**
|
826
|
+
* @public
|
827
|
+
*/
|
828
|
+
export declare type Player = {
|
829
|
+
ad: any;
|
830
|
+
currentTime: any;
|
831
|
+
adSegment: any;
|
832
|
+
event: any;
|
833
|
+
events: any;
|
834
|
+
source: any;
|
835
|
+
state: any;
|
836
|
+
onPlaybackEnded: any;
|
837
|
+
onSourceChanged: any;
|
838
|
+
onStateChanged: any;
|
839
|
+
onTimeChanged: any;
|
840
|
+
pause: any;
|
841
|
+
play: any;
|
842
|
+
togglePlayPause: any;
|
843
|
+
register: any;
|
844
|
+
seekTo: any;
|
845
|
+
setVolume: any;
|
846
|
+
triggerEvent: any;
|
847
|
+
};
|
848
|
+
|
792
849
|
/**
|
793
850
|
* @public
|
794
851
|
*/
|
@@ -798,6 +855,65 @@ export declare interface PlayerCapability {
|
|
798
855
|
protocol: 'dash' | 'hls' | 'mp4';
|
799
856
|
}
|
800
857
|
|
858
|
+
/**
|
859
|
+
* @public
|
860
|
+
*/
|
861
|
+
export declare type PlayerConfig = {
|
862
|
+
/**
|
863
|
+
* Some devices do not seek exactly
|
864
|
+
*
|
865
|
+
* e.g. on Arris if we request seek to position P, in reality it will seek to P -+5s
|
866
|
+
* e.g. on Arris if we request play from position P, in reality it will play from P -+5s
|
867
|
+
* (on Arris the error margin varies according to video format)
|
868
|
+
*/
|
869
|
+
acceptablePositionAnomalyMs?: number;
|
870
|
+
/**
|
871
|
+
* Stream delay config
|
872
|
+
*
|
873
|
+
* IP TV apps have TV program / TV channel streams delayed relative to the original
|
874
|
+
* video source. Therefore stream markers taken from the original video source
|
875
|
+
* are delayed relative to the TV stream seen by end users of the IP TV app.
|
876
|
+
*
|
877
|
+
* This delay must be corrected.
|
878
|
+
*/
|
879
|
+
streamDelayConfig?: {
|
880
|
+
/**
|
881
|
+
* ID of the delay config
|
882
|
+
*/
|
883
|
+
id: string;
|
884
|
+
};
|
885
|
+
ui?: {
|
886
|
+
/**
|
887
|
+
* ID of a DOM element inside which Tivio should display its player-related UI
|
888
|
+
* such as ad buttons. This DOM element is an anchor point for Tivio UI. Preferably
|
889
|
+
* it should be a <div/> element styled to cover the whole area of the video player
|
890
|
+
* and it should be positioned to be on top the existing player UI (e.g. via z-index).
|
891
|
+
*/
|
892
|
+
domAnchorId: string | null;
|
893
|
+
};
|
894
|
+
protocols?: {
|
895
|
+
mp4?: {
|
896
|
+
/**
|
897
|
+
* Set to false if player does not support MP4 files that require full file download
|
898
|
+
* (i.e. they do not support progressive MP4 download and therefore the whole file
|
899
|
+
* must be downloaded before playback can start)
|
900
|
+
*/
|
901
|
+
fullFileDownloadSupport?: boolean;
|
902
|
+
};
|
903
|
+
};
|
904
|
+
/**
|
905
|
+
* Ad service settings
|
906
|
+
*/
|
907
|
+
adService?: {
|
908
|
+
/**
|
909
|
+
* Tivio - can be used in websites and TV apps. Does not support VPAID
|
910
|
+
* IMA - can be used only in websites. Supports VAST 2, partially VAST 3, VAST 4, SIMID 1.0, OM SDK 1.3,
|
911
|
+
* VPAID 2 (HTML5) https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/compatibility
|
912
|
+
*/
|
913
|
+
name: 'IMA SDK' | 'Tivio';
|
914
|
+
};
|
915
|
+
};
|
916
|
+
|
801
917
|
/**
|
802
918
|
* @public
|
803
919
|
*/
|
@@ -830,6 +946,18 @@ export declare interface PlayerInterface {
|
|
830
946
|
unmute?: () => void;
|
831
947
|
}
|
832
948
|
|
949
|
+
/**
|
950
|
+
* @public
|
951
|
+
*/
|
952
|
+
export declare interface PlayerInterfaceForPlayerWrapper {
|
953
|
+
/**
|
954
|
+
* @param {number} ms - milliseconds relative to start of video (relative to 0 ms)
|
955
|
+
* or in case of TV programs relative to start of the program (relative to source.from ms)
|
956
|
+
*/
|
957
|
+
seekTo: (ms: number) => void;
|
958
|
+
setSource: (source: Source | null) => void;
|
959
|
+
}
|
960
|
+
|
833
961
|
/**
|
834
962
|
* @public
|
835
963
|
*/
|
@@ -887,8 +1015,8 @@ export declare type PlayerWrapper = {
|
|
887
1015
|
source: InputSource | null;
|
888
1016
|
events: {
|
889
1017
|
isSupported: (even: string) => boolean;
|
890
|
-
addListener: <T = any>(event: string, cb: (value: T) =>
|
891
|
-
removeListener: <T = any>(event: string, cb: (value: T) =>
|
1018
|
+
addListener: <T = any>(event: string, cb: (value: T) => Empty_2) => void;
|
1019
|
+
removeListener: <T = any>(event: string, cb: (value: T) => Empty_2) => void;
|
892
1020
|
removeAllListeners: () => void;
|
893
1021
|
};
|
894
1022
|
/**
|
@@ -926,6 +1054,19 @@ export declare type PlayerWrapper = {
|
|
926
1054
|
toggleMuted: () => void;
|
927
1055
|
};
|
928
1056
|
|
1057
|
+
/**
|
1058
|
+
* @public
|
1059
|
+
*/
|
1060
|
+
export declare enum PlayerWrapperEventType {
|
1061
|
+
adMetadata = "adMetadata",
|
1062
|
+
markers = "markers"
|
1063
|
+
}
|
1064
|
+
|
1065
|
+
/**
|
1066
|
+
* @public
|
1067
|
+
*/
|
1068
|
+
export declare type PlayerWrapperEventTypeType = `${PlayerWrapperEventType}`;
|
1069
|
+
|
929
1070
|
/**
|
930
1071
|
* @public
|
931
1072
|
*/
|
@@ -938,18 +1079,30 @@ export declare interface PubSub {
|
|
938
1079
|
* @public
|
939
1080
|
*/
|
940
1081
|
export declare type Purchase = {
|
1082
|
+
/**
|
1083
|
+
* Timestamp of the purchase creation in milliseconds.
|
1084
|
+
*/
|
1085
|
+
created: number | null;
|
1086
|
+
expirationDate: Date | null;
|
941
1087
|
id: string;
|
1088
|
+
isExpired: boolean;
|
1089
|
+
/**
|
1090
|
+
* @deprecated isPurchased is ambiguous name. Now it means that purchase.status is "PAID".
|
1091
|
+
* So use purchase.status === PurchaseStatus.PAID instead.
|
1092
|
+
*/
|
942
1093
|
isPurchased: boolean;
|
943
|
-
monetizationRef: any | null;
|
944
1094
|
monetization: PurchaseMonetization | null;
|
945
1095
|
monetizationId: string | null;
|
946
|
-
|
947
|
-
videoId: string | null;
|
1096
|
+
monetizationRef: any | null;
|
948
1097
|
status: PurchaseStatus | null;
|
1098
|
+
type: PurchaseType | null;
|
1099
|
+
/**
|
1100
|
+
* Timestamp of the last purchase status update in milliseconds.
|
1101
|
+
*/
|
1102
|
+
updated: number | null;
|
949
1103
|
video: Video | null;
|
1104
|
+
videoId: string | null;
|
950
1105
|
videoRef: any | null;
|
951
|
-
expirationDate: Date | null;
|
952
|
-
isExpired: boolean;
|
953
1106
|
voucherId?: string;
|
954
1107
|
};
|
955
1108
|
|
@@ -960,7 +1113,10 @@ export declare type PurchaseMonetization = {
|
|
960
1113
|
currency?: Currency;
|
961
1114
|
period?: number;
|
962
1115
|
price?: number;
|
963
|
-
|
1116
|
+
/**
|
1117
|
+
* Here are only transaction and subscription, because purchasing of advertisement monetization doesn't make sense.
|
1118
|
+
*/
|
1119
|
+
type: 'transaction' | 'subscription';
|
964
1120
|
title?: string;
|
965
1121
|
frequency?: MONETIZATION_FREQUENCY | null;
|
966
1122
|
/**
|
@@ -981,9 +1137,16 @@ export declare enum PurchaseStatus {
|
|
981
1137
|
/**
|
982
1138
|
* Used when purchase is terminated due to terms and conditions violation (e.g. restreaming).
|
983
1139
|
*/
|
984
|
-
|
1140
|
+
BLOCKED = "BLOCKED"
|
985
1141
|
}
|
986
1142
|
|
1143
|
+
/**
|
1144
|
+
* Purchase is a purchase of one video (transaction type), purchase of subscription or voucher.
|
1145
|
+
*
|
1146
|
+
* @public
|
1147
|
+
*/
|
1148
|
+
export declare type PurchaseType = 'transaction' | 'subscription' | 'voucher';
|
1149
|
+
|
987
1150
|
/**
|
988
1151
|
* @public
|
989
1152
|
*/
|
@@ -997,7 +1160,7 @@ export declare interface QerkoCancellationInfo {
|
|
997
1160
|
*/
|
998
1161
|
export declare interface QerkoData {
|
999
1162
|
monetization: Monetization;
|
1000
|
-
|
1163
|
+
item?: Video | TvChannel;
|
1001
1164
|
onPurchase?: () => void;
|
1002
1165
|
onClose?: () => void;
|
1003
1166
|
}
|
@@ -1050,13 +1213,25 @@ export declare interface QerkoTransaction {
|
|
1050
1213
|
voucherId?: string;
|
1051
1214
|
}
|
1052
1215
|
|
1216
|
+
/**
|
1217
|
+
* @public
|
1218
|
+
*/
|
1219
|
+
export declare type ReactNativeDeviceInfo = {
|
1220
|
+
type: 'react-native';
|
1221
|
+
/**
|
1222
|
+
* Type values defined according to {@link OperatingSystem} from `detect-browser` package for convenience.
|
1223
|
+
*/
|
1224
|
+
os?: 'iOS' | 'Android OS';
|
1225
|
+
osVersion: string;
|
1226
|
+
platform: PLATFORM;
|
1227
|
+
};
|
1228
|
+
|
1053
1229
|
/**
|
1054
1230
|
* @public
|
1055
1231
|
*/
|
1056
1232
|
export declare type RemoteBundleState = {
|
1057
1233
|
config: InternalConfig;
|
1058
1234
|
error: string | null;
|
1059
|
-
settings: Settings;
|
1060
1235
|
state: 'loading' | 'error' | 'ready';
|
1061
1236
|
} & Nullable<TivioBundle>;
|
1062
1237
|
|
@@ -1065,7 +1240,7 @@ export declare type RemoteBundleState = {
|
|
1065
1240
|
*/
|
1066
1241
|
export declare type RemoteProviderProps = {
|
1067
1242
|
disableUnmounting?: boolean;
|
1068
|
-
language?:
|
1243
|
+
language?: LangCode;
|
1069
1244
|
children: any;
|
1070
1245
|
};
|
1071
1246
|
|
@@ -1139,6 +1314,7 @@ export declare interface RowItemAssets {
|
|
1139
1314
|
portrait?: string | null;
|
1140
1315
|
circled?: string | null;
|
1141
1316
|
banner?: string | null;
|
1317
|
+
bannerMobile?: string | null;
|
1142
1318
|
}
|
1143
1319
|
|
1144
1320
|
/**
|
@@ -1220,6 +1396,27 @@ export declare type ScreenRowType = 'filter' | 'custom' | 'continueToWatch' | 'f
|
|
1220
1396
|
*/
|
1221
1397
|
export declare type ScreenSubscription = (screenId: string, cb: (error: Error | null, data: Screen_2 | null) => void) => Disposer_2;
|
1222
1398
|
|
1399
|
+
/**
|
1400
|
+
* Config of sdk-react. Contains all properties that can be passed via TivioProvider.
|
1401
|
+
* Consists of TivioConfig's properties + "sdk only" properties, that are used only in sdk, not in bundle.
|
1402
|
+
*
|
1403
|
+
* @public
|
1404
|
+
*/
|
1405
|
+
export declare type SdkReactConfig = Omit<TivioConfig, 'language'> & {
|
1406
|
+
disableUnmounting?: boolean;
|
1407
|
+
enable?: boolean;
|
1408
|
+
enableSentry?: boolean;
|
1409
|
+
ErrorComponent?: ComponentType<{
|
1410
|
+
error: string | null;
|
1411
|
+
}>;
|
1412
|
+
LoaderComponent?: ComponentType;
|
1413
|
+
logger?: Logger | null;
|
1414
|
+
/**
|
1415
|
+
* language is required for bundle init (TivioConfig), but it can be set to default EN on SDK side, so here it's optional.
|
1416
|
+
*/
|
1417
|
+
language?: LangCode;
|
1418
|
+
};
|
1419
|
+
|
1223
1420
|
/**
|
1224
1421
|
* @public
|
1225
1422
|
*/
|
@@ -1230,21 +1427,6 @@ export declare interface Section {
|
|
1230
1427
|
videos: Video[];
|
1231
1428
|
}
|
1232
1429
|
|
1233
|
-
/**
|
1234
|
-
* @public
|
1235
|
-
*/
|
1236
|
-
export declare const SectionsContext: React_2.Context<DataState<Section>>;
|
1237
|
-
|
1238
|
-
/**
|
1239
|
-
* @public
|
1240
|
-
*/
|
1241
|
-
export declare type Settings = {
|
1242
|
-
/**
|
1243
|
-
* @deprecated TIV-994 in favour of setUser from libs/sdk-react/src/services/login.ts
|
1244
|
-
*/
|
1245
|
-
setUser: (userId: string, userPayload: unknown) => Promise<void>;
|
1246
|
-
};
|
1247
|
-
|
1248
1430
|
/**
|
1249
1431
|
* Used for entities, that can be global (e.g. asset presets, tag types).
|
1250
1432
|
* Non-global is stored under organizations (in sub-collection), and shown for organization's users and super-admin.
|
@@ -1270,6 +1452,63 @@ export declare const setUser: (userId: string | null, payload?: UserPayload | un
|
|
1270
1452
|
*/
|
1271
1453
|
export declare const showGdprConsentPreferences: () => Promise<void>;
|
1272
1454
|
|
1455
|
+
/**
|
1456
|
+
* @public
|
1457
|
+
*/
|
1458
|
+
export declare type Source = TvProgramSource | TivioVodSource | AdSource_2 | OtherSource | LiveTvChannelSource;
|
1459
|
+
|
1460
|
+
/**
|
1461
|
+
* @public
|
1462
|
+
*/
|
1463
|
+
export declare type SourceBase = {
|
1464
|
+
/**
|
1465
|
+
* Tivio SDK users may use pretty complicated source objects in their existing code and if Tivio player
|
1466
|
+
* is an interception layer, it should allow them to pass through any type of object.
|
1467
|
+
*/
|
1468
|
+
additionalPayload?: Record<string, any>;
|
1469
|
+
/**
|
1470
|
+
* Source type.
|
1471
|
+
*/
|
1472
|
+
type: 'ad' | 'live_tv_channel' | 'other' | 'tivio_vod' | 'tv_program';
|
1473
|
+
/**
|
1474
|
+
* URI to play.
|
1475
|
+
*/
|
1476
|
+
uri: string;
|
1477
|
+
};
|
1478
|
+
|
1479
|
+
/**
|
1480
|
+
* @public
|
1481
|
+
*/
|
1482
|
+
export declare type StartAndContinuePosition = {
|
1483
|
+
/**
|
1484
|
+
* Relative from stream start, in ms.
|
1485
|
+
*
|
1486
|
+
* On input to Tivio either `startFromPosition` or `continueFromPosition` must always be provided.
|
1487
|
+
*
|
1488
|
+
* On output from Tivio it is always defined. Tivio can change this value.
|
1489
|
+
* (e.g. in order to fix start position of a TV program)
|
1490
|
+
*/
|
1491
|
+
startFromPosition?: number;
|
1492
|
+
/**
|
1493
|
+
* Relative from stream start, in ms.
|
1494
|
+
*
|
1495
|
+
* On input to Tivio either `startFromPosition` or `continueFromPosition` must always be provided.
|
1496
|
+
*
|
1497
|
+
* If provided, tivio will not correct it and will send this value back in startFromPosition.
|
1498
|
+
* If provided, startFromPosition is ignored.
|
1499
|
+
*/
|
1500
|
+
continueFromPosition?: number;
|
1501
|
+
};
|
1502
|
+
|
1503
|
+
/**
|
1504
|
+
* @public
|
1505
|
+
*/
|
1506
|
+
declare interface StorageManager_2 {
|
1507
|
+
getItem(key: string): string | null | Promise<string | null>;
|
1508
|
+
setItem(key: string, value: string): void | Promise<void>;
|
1509
|
+
}
|
1510
|
+
export { StorageManager_2 as StorageManager }
|
1511
|
+
|
1273
1512
|
/**
|
1274
1513
|
* @public
|
1275
1514
|
*/
|
@@ -1369,7 +1608,6 @@ export declare type TaggedVideosOrderByField = 'seasonNumber' | 'episodeNumber'
|
|
1369
1608
|
*/
|
1370
1609
|
export declare type TileProps = {
|
1371
1610
|
cover: string;
|
1372
|
-
isLoading: boolean;
|
1373
1611
|
bottomLabel: string;
|
1374
1612
|
bottomLabelAreaHeight: number;
|
1375
1613
|
innerLabel: string;
|
@@ -1378,7 +1616,6 @@ export declare type TileProps = {
|
|
1378
1616
|
focused: boolean;
|
1379
1617
|
onClick?: () => void;
|
1380
1618
|
hoverable: boolean;
|
1381
|
-
overlay: boolean;
|
1382
1619
|
coverPadding: CoverPadding;
|
1383
1620
|
variant: RowItemComponent;
|
1384
1621
|
coverWidth: number;
|
@@ -1402,10 +1639,6 @@ export declare type TilePropsPartial = Partial<TileProps>;
|
|
1402
1639
|
* @public
|
1403
1640
|
*/
|
1404
1641
|
export declare interface TivioAuth {
|
1405
|
-
changePassword: (newPassword: string) => Promise<void>;
|
1406
|
-
changeUserPhoto(file: any): Promise<void>;
|
1407
|
-
removeUserPhoto(): Promise<void>;
|
1408
|
-
getPurchasedVodsWithInitializedVideos: () => Promise<Purchase[]>;
|
1409
1642
|
/**
|
1410
1643
|
* @param email
|
1411
1644
|
* @param password
|
@@ -1417,21 +1650,17 @@ export declare interface TivioAuth {
|
|
1417
1650
|
* @param password
|
1418
1651
|
*/
|
1419
1652
|
signInWithEmailAndPassword: (email: string, password: string) => Promise<string | null>;
|
1420
|
-
initializeUser: () => Promise<void>;
|
1421
1653
|
signOut: () => Promise<void>;
|
1422
1654
|
/**
|
1423
1655
|
* Used for reset forgotten password by user
|
1424
1656
|
*/
|
1425
1657
|
resetPassword: (email: string) => Promise<void>;
|
1426
|
-
createFreePurchase: (monetizationId: string) => Promise<void>;
|
1427
1658
|
}
|
1428
1659
|
|
1429
1660
|
/**
|
1430
1661
|
* @public
|
1431
1662
|
*/
|
1432
|
-
export declare type TivioBundle =
|
1433
|
-
init: (config: Config) => void | Promise<void>;
|
1434
|
-
};
|
1663
|
+
export declare type TivioBundle = TivioReactBundle;
|
1435
1664
|
|
1436
1665
|
/**
|
1437
1666
|
* @public
|
@@ -1447,10 +1676,6 @@ export declare type TivioComponents = {
|
|
1447
1676
|
Markers: React_2.ReactNode;
|
1448
1677
|
PlayerDataContext: React_2.ReactNode;
|
1449
1678
|
Provider: React_2.ComponentType<RemoteProviderProps>;
|
1450
|
-
/**
|
1451
|
-
* @deprecated will be removed in in @tivio/sdk-react@4
|
1452
|
-
*/
|
1453
|
-
VideoAdBanner: React_2.ReactNode;
|
1454
1679
|
WebPlayer: React_2.ComponentType<WebPlayerProps>;
|
1455
1680
|
Widget: React_2.ComponentType<TivioWidgetProps>;
|
1456
1681
|
PlayerDataContextProvider: React_2.ComponentType<{
|
@@ -1479,12 +1704,46 @@ export declare type TivioComponents = {
|
|
1479
1704
|
WebTile: React_2.ComponentType<{
|
1480
1705
|
item?: ItemsInRow;
|
1481
1706
|
} & TilePropsPartial>;
|
1482
|
-
AdIndicationButtonWeb: React_2.ReactNode;
|
1483
|
-
Recommendation: React_2.ReactNode;
|
1484
|
-
SkipButtonWeb: React_2.ReactNode;
|
1485
|
-
TvPlayer: React_2.ComponentType<WebPlayerProps>;
|
1486
1707
|
};
|
1487
1708
|
|
1709
|
+
/**
|
1710
|
+
* @public
|
1711
|
+
*/
|
1712
|
+
export declare interface TivioConfig {
|
1713
|
+
/**
|
1714
|
+
* Tells Tivio which technologies/protocols etc. is the device capable to play.
|
1715
|
+
* If not provided, Tivio will try to guess it (based on the browser).
|
1716
|
+
*/
|
1717
|
+
deviceCapabilities?: PlayerCapability[];
|
1718
|
+
/**
|
1719
|
+
* Additional options for deviceCapabilities
|
1720
|
+
*/
|
1721
|
+
capabilitiesOptions?: {
|
1722
|
+
/**
|
1723
|
+
* Should the player prefer HTTP sources instead HTTPs if they are available.
|
1724
|
+
* This can be used on platforms that support mixed content but do not support
|
1725
|
+
* specific HTTPS certificates. (e.g. certificates from Letsencrypt not supported on LG TVs)
|
1726
|
+
*/
|
1727
|
+
preferHttp?: boolean;
|
1728
|
+
};
|
1729
|
+
secret: string;
|
1730
|
+
language: LangCode;
|
1731
|
+
debug?: boolean;
|
1732
|
+
verbose?: boolean;
|
1733
|
+
firebaseApp?: any;
|
1734
|
+
currency: Currency;
|
1735
|
+
/**
|
1736
|
+
* Configuration for GDPR consent collection (CMP)
|
1737
|
+
*/
|
1738
|
+
cmp?: CmpConfig;
|
1739
|
+
/**
|
1740
|
+
* Device information - model, os, version, etc. This is useful for devices
|
1741
|
+
* where this information cannot be reliably auto-detected.
|
1742
|
+
*/
|
1743
|
+
deviceInfo?: DeviceInfo;
|
1744
|
+
player?: PlayerConfig;
|
1745
|
+
}
|
1746
|
+
|
1488
1747
|
/**
|
1489
1748
|
* @public
|
1490
1749
|
*/
|
@@ -1496,18 +1755,6 @@ export declare const TivioContext: React_2.Context<RemoteBundleState | null>;
|
|
1496
1755
|
export declare type TivioGetters = {
|
1497
1756
|
isTivioLoaded: (cb: (isLoaded: boolean) => void) => void;
|
1498
1757
|
isSignedIn: () => boolean;
|
1499
|
-
/**
|
1500
|
-
* @deprecated is here only for backward compatibility
|
1501
|
-
*/
|
1502
|
-
getExportedConfig: () => Promise<{
|
1503
|
-
showMarkers: true;
|
1504
|
-
}>;
|
1505
|
-
/**
|
1506
|
-
* Get channel by its id.
|
1507
|
-
* @param channelId - channel id
|
1508
|
-
* @returns {Promise<Channel | null>} channel or null if channel does not exists
|
1509
|
-
*/
|
1510
|
-
getChannelById: (channelId: string) => Promise<Channel | null>;
|
1511
1758
|
/**
|
1512
1759
|
* Get (or create) player wrapper instance
|
1513
1760
|
* @param opt - player getter options
|
@@ -1515,26 +1762,14 @@ export declare type TivioGetters = {
|
|
1515
1762
|
*/
|
1516
1763
|
getPlayerWrapper: (opt: {
|
1517
1764
|
playerWrapperId?: string;
|
1518
|
-
}) =>
|
1765
|
+
}) => PlayerWrapper;
|
1519
1766
|
getOrganizationSubscriptions: () => Promise<Monetization[] | undefined>;
|
1520
|
-
/**
|
1521
|
-
* Get section by its id.
|
1522
|
-
* @param sectionId - section id
|
1523
|
-
* @returns {Promise<{section: Section, channel: Channel} | null>} section and channel or null if channel or section does not exists
|
1524
|
-
*/
|
1525
|
-
getSectionById: (sectionId: string) => Promise<Section | null>;
|
1526
1767
|
/**
|
1527
1768
|
* Get video by its id.
|
1528
1769
|
* @param videoId - video id
|
1529
1770
|
* @returns {Promise<Video | null>} video or null if video does not exists
|
1530
1771
|
*/
|
1531
1772
|
getVideoById: (videoId: string) => Promise<Video | null>;
|
1532
|
-
/**
|
1533
|
-
* Get widget by its id.
|
1534
|
-
* @param widgetId - widget id
|
1535
|
-
* @returns {Promise<Widget | null>} widget or null if widget does not exists
|
1536
|
-
*/
|
1537
|
-
getWidgetById: (widgetId: string) => Promise<Widget | null>;
|
1538
1773
|
/**
|
1539
1774
|
* Get player capabilities based on user's browser and OS as resolved by Tivio.
|
1540
1775
|
* @returns PlayerCapability[]
|
@@ -1546,7 +1781,7 @@ export declare type TivioGetters = {
|
|
1546
1781
|
* @public
|
1547
1782
|
*/
|
1548
1783
|
export declare type TivioHooks = {
|
1549
|
-
useAd: () => [(
|
1784
|
+
useAd: () => [(AdExternal | null)];
|
1550
1785
|
useAdSegment: () => AdSegment | null;
|
1551
1786
|
useCancelSubscription: UseCancelSubscription;
|
1552
1787
|
useItemsInRow: (rowId: string, options: PaginationOptions) => {
|
@@ -1575,10 +1810,6 @@ export declare type TivioHooks = {
|
|
1575
1810
|
error: string | null;
|
1576
1811
|
};
|
1577
1812
|
useVoucher: (voucherId: string) => any;
|
1578
|
-
/**
|
1579
|
-
* @deprecated will be removed in version
|
1580
|
-
*/
|
1581
|
-
useLastVideoByWidgetId: (widgetId: string) => Video | null;
|
1582
1813
|
useWatchWithoutAdsOffer: () => {
|
1583
1814
|
canPurchaseWatchWithoutAds: boolean;
|
1584
1815
|
showPurchaseDialog: () => void;
|
@@ -1661,6 +1892,51 @@ export declare type TivioInternalProviders = {
|
|
1661
1892
|
RouterOverridesContextProvider: React_2.ComponentType<RouterOverridesContextState>;
|
1662
1893
|
};
|
1663
1894
|
|
1895
|
+
/**
|
1896
|
+
* @public
|
1897
|
+
*/
|
1898
|
+
export declare type TivioJsBundleExposedApi = {
|
1899
|
+
AdSource: any;
|
1900
|
+
ChannelSource: any;
|
1901
|
+
VodTivioSource: any;
|
1902
|
+
/**
|
1903
|
+
* Get (or create) player wrapper instance
|
1904
|
+
* @param id - player wrapper id
|
1905
|
+
* @returns {Player} player wrapper instance
|
1906
|
+
*/
|
1907
|
+
getPlayer: (id: string) => Player;
|
1908
|
+
/**
|
1909
|
+
* Get tv channel by its id.
|
1910
|
+
* @param tvChannelId - tv channel id
|
1911
|
+
* @returns {Promise<TvChannel | null>} channel or null if tv channel does not exists
|
1912
|
+
*/
|
1913
|
+
getTvChannelById: (tvChannelId: string) => Promise<TvChannel | null>;
|
1914
|
+
/**
|
1915
|
+
* Get tag by its id.
|
1916
|
+
* @param tagId - tag id
|
1917
|
+
* @returns {Promise<Tag | null>} widget or null if tag does not exists
|
1918
|
+
*/
|
1919
|
+
getTagById: (tagId: string) => Promise<Tag | null>;
|
1920
|
+
createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
|
1921
|
+
destroy: () => Promise<void>;
|
1922
|
+
} & Pick<TivioGetters, 'getVideoById'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
|
1923
|
+
|
1924
|
+
/**
|
1925
|
+
* @public
|
1926
|
+
*/
|
1927
|
+
export declare interface TivioPlayerWrapper {
|
1928
|
+
addEventListener: (eventType: PlayerWrapperEventTypeType, listener: Listener) => void;
|
1929
|
+
reportError: (error: Error) => void;
|
1930
|
+
reportPlaybackEnded: () => void;
|
1931
|
+
reportTimeProgress: (ms: number) => void;
|
1932
|
+
seekTo: (ms: number) => void;
|
1933
|
+
/**
|
1934
|
+
* @param {Source} source - source to set
|
1935
|
+
* @param {string} calibrationId - id of calibration profile
|
1936
|
+
*/
|
1937
|
+
setSource: (source: Source | null, calibrationId?: string) => void;
|
1938
|
+
}
|
1939
|
+
|
1664
1940
|
/**
|
1665
1941
|
* @public
|
1666
1942
|
*/
|
@@ -1673,10 +1949,52 @@ export declare type TivioProviderProps = {
|
|
1673
1949
|
/**
|
1674
1950
|
* This prop must be set only once and not change value afterwards
|
1675
1951
|
*/
|
1676
|
-
conf:
|
1952
|
+
conf: SdkReactConfig | undefined | null;
|
1677
1953
|
children: React_2.ReactNode;
|
1678
1954
|
};
|
1679
1955
|
|
1956
|
+
/**
|
1957
|
+
* @public
|
1958
|
+
*/
|
1959
|
+
export declare type TivioReactBundle = {
|
1960
|
+
init: (config: TivioConfig) => void | Promise<void>;
|
1961
|
+
components: TivioComponents;
|
1962
|
+
getters: TivioGetters;
|
1963
|
+
auth: TivioAuth;
|
1964
|
+
hooks: TivioHooks;
|
1965
|
+
sources: TivioSources;
|
1966
|
+
subscriptions: TivioSubscriptions;
|
1967
|
+
purchaseVideoWithQerko: (videoId: string, monetizationId: string, voucher?: {
|
1968
|
+
expirationDate: Date;
|
1969
|
+
}) => Promise<QerkoPaymentInfo>;
|
1970
|
+
purchaseSubscriptionWithQerko: (monetizationId: string, voucher?: {
|
1971
|
+
expirationDate: Date;
|
1972
|
+
}) => Promise<QerkoPaymentInfo>;
|
1973
|
+
cancelSubscriptionWithQerko: (subscriptionId: string) => Promise<QerkoCancellationInfo>;
|
1974
|
+
showConsentPreferences: () => void;
|
1975
|
+
/**
|
1976
|
+
* Contains hooks and providers for internal usages.
|
1977
|
+
* They used in our apps, e.g. web, or in sdk-react (e.g. some sdk hooks are just wrappers for core-react-dom hooks)
|
1978
|
+
* TODO should not be the part of public API
|
1979
|
+
*/
|
1980
|
+
internal: TivioInternalBundle;
|
1981
|
+
destroy: () => Promise<void>;
|
1982
|
+
} & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
|
1983
|
+
|
1984
|
+
/**
|
1985
|
+
* @public
|
1986
|
+
*/
|
1987
|
+
export declare type TivioSetters = {
|
1988
|
+
setBundleVersion: (bundleVersion: string | null) => void;
|
1989
|
+
/**
|
1990
|
+
* Set tivio language.
|
1991
|
+
* @param language
|
1992
|
+
*/
|
1993
|
+
setLanguage: (language: LangCode) => void;
|
1994
|
+
setStorageManager: (storageManager: StorageManager_2) => void;
|
1995
|
+
setUser: (userId: string | null, userPayload?: UserPayload) => Promise<void>;
|
1996
|
+
};
|
1997
|
+
|
1680
1998
|
/**
|
1681
1999
|
* @public
|
1682
2000
|
*/
|
@@ -1692,61 +2010,12 @@ export declare type TivioSources = {
|
|
1692
2010
|
*/
|
1693
2011
|
export declare type TivioSubscriptions = {
|
1694
2012
|
subscribeToUser: (cb: (error: string | null, user: User | null) => void) => void;
|
1695
|
-
/**
|
1696
|
-
* Listen to widget changes.
|
1697
|
-
* @param widgetId - widget id
|
1698
|
-
* @param cb - callback on widget updates or on error
|
1699
|
-
*/
|
1700
|
-
subscribeToWidget: (widgetId: string, cb: (error: Error | null, data: Widget | null, disposer?: Disposer_2) => void) => void;
|
1701
|
-
/**
|
1702
|
-
* Listen to channel changes.
|
1703
|
-
* @param channelId - channel id
|
1704
|
-
* @param cb - callback on channel updates or on error
|
1705
|
-
*/
|
1706
|
-
subscribeToChannel: (channelId: string, cb: (error: Error | null, data: Channel | null) => void) => void;
|
1707
|
-
/**
|
1708
|
-
* Listen to section changes.
|
1709
|
-
* @param sectionId - section id
|
1710
|
-
* @param cb - callback on section updates or on error
|
1711
|
-
*/
|
1712
|
-
subscribeToSection: (sectionId: string, cb: (error: Error | null, data: Section | null) => void) => void;
|
1713
2013
|
/**
|
1714
2014
|
* Listen to video changes.
|
1715
2015
|
* @param videoId - video id
|
1716
2016
|
* @param cb - callback on video updates or on error
|
1717
2017
|
*/
|
1718
2018
|
subscribeToVideo: (videoId: string, cb: (error: Error | null, data: Video | null, disposer?: Disposer_2) => void) => void;
|
1719
|
-
/**
|
1720
|
-
* Listen to videos in section changes.
|
1721
|
-
* @param sectionId - section id
|
1722
|
-
* @param cb - callback on videos change or error
|
1723
|
-
* @param limit - videos count
|
1724
|
-
*/
|
1725
|
-
subscribeToVideosInSection: (sectionId: string, cb: (error: null | Error, data: null | {
|
1726
|
-
videos: Video[];
|
1727
|
-
hasNextPage: boolean;
|
1728
|
-
}, fetchMore: null | ((count?: number) => void), isLoading: boolean) => void, limit?: number) => void;
|
1729
|
-
/**
|
1730
|
-
* Listen to section in channel changes
|
1731
|
-
* @param channelId - channel id
|
1732
|
-
* @param cb - callback on sections change or error
|
1733
|
-
* @param limit - sections count
|
1734
|
-
*/
|
1735
|
-
subscribeToSectionsInChannel: (channelId: string, cb: (error: null | Error, data: null | {
|
1736
|
-
sections: Section[];
|
1737
|
-
hasNextPage: boolean;
|
1738
|
-
}, fetchMore: null | ((count?: number) => void), isLoading: boolean) => void, limit?: number) => void;
|
1739
|
-
/**
|
1740
|
-
* Listen to channels in widget changes
|
1741
|
-
* @param widgetId - widget id
|
1742
|
-
* @param cb - callback on channels change or error
|
1743
|
-
* @param limit - channels count
|
1744
|
-
*/
|
1745
|
-
subscribeToChannelsInWidget: (widgetId: string, cb: (error: null | Error, data: null | {
|
1746
|
-
channels: Channel[];
|
1747
|
-
hasNextPage: boolean;
|
1748
|
-
}, fetchMore: null | ((count?: number) => void), isLoading: boolean) => void, limit?: number) => void;
|
1749
|
-
subscribeToScreen: SubscribeToScreen;
|
1750
2019
|
subscribeToItemsInRow: SubscribeToItemsInRow;
|
1751
2020
|
subscribeToRowsInScreen: SubscribeToRowsInScreen;
|
1752
2021
|
subscribeToTaggedVideos: SubscribeToTaggedVideos;
|
@@ -1756,6 +2025,17 @@ export declare type TivioSubscriptions = {
|
|
1756
2025
|
}) => void;
|
1757
2026
|
};
|
1758
2027
|
|
2028
|
+
/**
|
2029
|
+
* @public
|
2030
|
+
*/
|
2031
|
+
export declare type TivioVodSource = SourceBase & StartAndContinuePosition & {
|
2032
|
+
type: 'tivio_vod';
|
2033
|
+
/**
|
2034
|
+
* Allows Tivio to load monetization config an apply ads.
|
2035
|
+
*/
|
2036
|
+
videoPath: string;
|
2037
|
+
};
|
2038
|
+
|
1759
2039
|
/**
|
1760
2040
|
* @public
|
1761
2041
|
*/
|
@@ -1845,6 +2125,35 @@ export declare interface TvChannel extends RowItem {
|
|
1845
2125
|
price: number;
|
1846
2126
|
}
|
1847
2127
|
|
2128
|
+
/**
|
2129
|
+
* @public
|
2130
|
+
*/
|
2131
|
+
export declare type TvProgramSource = SourceBase & StartAndContinuePosition & {
|
2132
|
+
type: 'tv_program';
|
2133
|
+
/**
|
2134
|
+
* If epgTo is wrong, Tivio cannot correctly guess if the video it startover or timeshift . For such cases
|
2135
|
+
* Tivio needs explicit tv mode.
|
2136
|
+
* null if source begins in the future.
|
2137
|
+
*/
|
2138
|
+
tvMode: 'startover' | 'timeshift' | null;
|
2139
|
+
/**
|
2140
|
+
* Tivio needs channel name in order to load markers.
|
2141
|
+
*/
|
2142
|
+
channelName: string;
|
2143
|
+
/**
|
2144
|
+
* Tivio needs EPG from in order to load markers.
|
2145
|
+
*/
|
2146
|
+
epgFrom: Date;
|
2147
|
+
/**
|
2148
|
+
* Tivio needs EPG to in order to load markers.
|
2149
|
+
*/
|
2150
|
+
epgTo: Date;
|
2151
|
+
/**
|
2152
|
+
* When the stream (provided in uri) really starts - typically few minutes before epgFrom.
|
2153
|
+
*/
|
2154
|
+
streamStart: Date;
|
2155
|
+
};
|
2156
|
+
|
1848
2157
|
/**
|
1849
2158
|
* @public
|
1850
2159
|
*/
|
@@ -1853,7 +2162,7 @@ export declare const TvTivioProvider: React_2.FC<TivioProviderProps>;
|
|
1853
2162
|
/**
|
1854
2163
|
* @public
|
1855
2164
|
*/
|
1856
|
-
export declare const useAd: () =>
|
2165
|
+
export declare const useAd: () => AdExternal | null;
|
1857
2166
|
|
1858
2167
|
/**
|
1859
2168
|
* @public
|
@@ -1907,28 +2216,6 @@ export declare type UseCancelSubscription = (subscriptionId: string) => {
|
|
1907
2216
|
*/
|
1908
2217
|
export declare const useCancelSubscription: UseCancelSubscription;
|
1909
2218
|
|
1910
|
-
/**
|
1911
|
-
* Use channel
|
1912
|
-
* @param channelId - channel id
|
1913
|
-
* @public
|
1914
|
-
*/
|
1915
|
-
export declare const useChannel: (channelId: string) => {
|
1916
|
-
error: string | null;
|
1917
|
-
data: Channel | null;
|
1918
|
-
};
|
1919
|
-
|
1920
|
-
/**
|
1921
|
-
* Use channels in widget
|
1922
|
-
* @param widgetId - widget id
|
1923
|
-
* @param [limit] - channels count, defaults to 10
|
1924
|
-
* @public
|
1925
|
-
*/
|
1926
|
-
export declare const useChannelsInWidget: (widgetId: string, limit?: number) => {
|
1927
|
-
error: Error | null;
|
1928
|
-
data: PaginationData<Channel> | null;
|
1929
|
-
isLoading: boolean;
|
1930
|
-
};
|
1931
|
-
|
1932
2219
|
/**
|
1933
2220
|
* @public
|
1934
2221
|
*/
|
@@ -1942,13 +2229,6 @@ export declare type UseChannelSource = (tvChannelId: string) => {
|
|
1942
2229
|
*/
|
1943
2230
|
export declare const useCurrentMarker: () => Marker | null;
|
1944
2231
|
|
1945
|
-
/**
|
1946
|
-
* @public
|
1947
|
-
*/
|
1948
|
-
export declare const useFreePurchase: () => {
|
1949
|
-
purchase: (monetizationId: string) => Promise<void>;
|
1950
|
-
};
|
1951
|
-
|
1952
2232
|
/**
|
1953
2233
|
* @public
|
1954
2234
|
*/
|
@@ -1979,12 +2259,6 @@ export declare const useItemsInRow: (rowId: string, options?: SubscribeToItemsIn
|
|
1979
2259
|
error: Error | null;
|
1980
2260
|
};
|
1981
2261
|
|
1982
|
-
/**
|
1983
|
-
* @deprecated will be removed in v4
|
1984
|
-
* @public
|
1985
|
-
*/
|
1986
|
-
export declare function useLastVideoByWidgetId(widgetId: string): Video | null;
|
1987
|
-
|
1988
2262
|
/**
|
1989
2263
|
* @public
|
1990
2264
|
*/
|
@@ -2040,9 +2314,23 @@ export declare const usePurchasesWithVideos: () => {
|
|
2040
2314
|
* @public
|
2041
2315
|
*/
|
2042
2316
|
export declare type User = {
|
2317
|
+
/**
|
2318
|
+
* Returns "active" (non-expired) purchases, so they give access to some content.
|
2319
|
+
* Does not return voucher purchases, because they give access to videos/subscriptions only for user who activates voucher,
|
2320
|
+
* not for user who purchases it.
|
2321
|
+
*/
|
2043
2322
|
purchases: Purchase[];
|
2323
|
+
/**
|
2324
|
+
* Returns all PAID or CANCELLED user purchases (expired and non-expired)
|
2325
|
+
*/
|
2044
2326
|
allPurchases: Purchase[];
|
2327
|
+
/**
|
2328
|
+
* Returns "active" (not CANCELLED) VoD purchases ("transaction" type)
|
2329
|
+
*/
|
2045
2330
|
purchasedVods: Purchase[];
|
2331
|
+
/**
|
2332
|
+
* Returns "active" (non-expired) subscription purchases
|
2333
|
+
*/
|
2046
2334
|
purchasedSubscriptions: Purchase[];
|
2047
2335
|
isPurchasesInitialized: boolean;
|
2048
2336
|
isSignedIn: boolean;
|
@@ -2076,16 +2364,6 @@ export declare enum UserType {
|
|
2076
2364
|
TIVIO_USER = "TIVIO_USER"
|
2077
2365
|
}
|
2078
2366
|
|
2079
|
-
/**
|
2080
|
-
* @deprecated
|
2081
|
-
*
|
2082
|
-
* Use app screen
|
2083
|
-
* @param screenId - screen ID
|
2084
|
-
* @param options - subscribe to screen options
|
2085
|
-
* @public
|
2086
|
-
*/
|
2087
|
-
export declare const useScreen: (screenId: string, options?: ScreenOptions | undefined) => never;
|
2088
|
-
|
2089
2367
|
/**
|
2090
2368
|
* @public
|
2091
2369
|
*/
|
@@ -2117,28 +2395,6 @@ export declare type UseSearchOptions = PaginationOptions & Partial<{
|
|
2117
2395
|
*/
|
2118
2396
|
export declare type UseSearchResult<T extends ALGOLIA_INDEX_NAME> = T extends ALGOLIA_INDEX_NAME.VIDEOS ? Video : T extends ALGOLIA_INDEX_NAME.TAGS ? Tag : T extends ALGOLIA_INDEX_NAME.TV_CHANNELS ? TvChannel : unknown;
|
2119
2397
|
|
2120
|
-
/**
|
2121
|
-
* Use section
|
2122
|
-
* @param sectionId - section id
|
2123
|
-
* @public
|
2124
|
-
*/
|
2125
|
-
export declare const useSection: (sectionId: string) => {
|
2126
|
-
error: string | null;
|
2127
|
-
data: Section | null;
|
2128
|
-
};
|
2129
|
-
|
2130
|
-
/**
|
2131
|
-
* Use section in channel
|
2132
|
-
* @param channelId - channel id
|
2133
|
-
* @param [limit] - sections count, defaults to 10
|
2134
|
-
* @public
|
2135
|
-
*/
|
2136
|
-
export declare const useSectionsInChannel: (channelId: string, limit?: number) => {
|
2137
|
-
error: Error | null;
|
2138
|
-
data: PaginationData<Section> | null;
|
2139
|
-
isLoading: boolean;
|
2140
|
-
};
|
2141
|
-
|
2142
2398
|
/**
|
2143
2399
|
* @public
|
2144
2400
|
*/
|
@@ -2198,18 +2454,6 @@ export declare const useVideo: (videoId?: string | undefined) => {
|
|
2198
2454
|
error: string | null;
|
2199
2455
|
};
|
2200
2456
|
|
2201
|
-
/**
|
2202
|
-
* Use videos in section
|
2203
|
-
* @param sectionId - section id
|
2204
|
-
* @param [limit] - videos count, defaults to 10
|
2205
|
-
* @public
|
2206
|
-
*/
|
2207
|
-
export declare const useVideosInSection: (sectionId?: string | undefined, limit?: number) => {
|
2208
|
-
error: Error | null;
|
2209
|
-
data: PaginationData<Video> | null;
|
2210
|
-
isLoading: boolean;
|
2211
|
-
};
|
2212
|
-
|
2213
2457
|
/**
|
2214
2458
|
* @public
|
2215
2459
|
*/
|
@@ -2235,16 +2479,6 @@ export declare const useWatchWithoutAdsOffer: () => {
|
|
2235
2479
|
showPurchaseDialog: () => void;
|
2236
2480
|
};
|
2237
2481
|
|
2238
|
-
/**
|
2239
|
-
* Use widget
|
2240
|
-
* @param widgetId - widget id
|
2241
|
-
* @public
|
2242
|
-
*/
|
2243
|
-
export declare const useWidget: (widgetId: string) => {
|
2244
|
-
error: string;
|
2245
|
-
widget: Widget | null;
|
2246
|
-
};
|
2247
|
-
|
2248
2482
|
/**
|
2249
2483
|
* @public
|
2250
2484
|
*/
|
@@ -2273,7 +2507,8 @@ export declare enum VastProvider {
|
|
2273
2507
|
MALL_TV = "malltv",
|
2274
2508
|
MALL_TV_PREBID = "malltv-prebid",
|
2275
2509
|
PRIMA = "prima",
|
2276
|
-
TEST = "test"
|
2510
|
+
TEST = "test",
|
2511
|
+
TEST_VPAID = "test-vpaid"
|
2277
2512
|
}
|
2278
2513
|
|
2279
2514
|
/**
|
@@ -2355,26 +2590,10 @@ export declare enum VideoContentType {
|
|
2355
2590
|
/**
|
2356
2591
|
* @public
|
2357
2592
|
*/
|
2358
|
-
export declare
|
2359
|
-
tvProfiProgramId?: string;
|
2360
|
-
tvProfiContentId?: string;
|
2361
|
-
tvProfiSerialId?: string;
|
2362
|
-
contentId?: string;
|
2363
|
-
provysId?: string;
|
2364
|
-
mallTvEntityId?: string;
|
2365
|
-
/**
|
2366
|
-
* DRM content Key ID - should't be more connected with buyDRM or streamOnline? It is not general thing
|
2367
|
-
*/
|
2368
|
-
keyId?: string;
|
2369
|
-
}
|
2593
|
+
export declare type VideoExternals = JojExternals | MallTvExternals | OktagonExternals;
|
2370
2594
|
|
2371
2595
|
declare type VideoPath = string;
|
2372
2596
|
|
2373
|
-
/**
|
2374
|
-
* @public
|
2375
|
-
*/
|
2376
|
-
export declare const VideosContext: React_2.Context<DataState<Video>>;
|
2377
|
-
|
2378
2597
|
/**
|
2379
2598
|
* Video type.
|
2380
2599
|
* @public
|
@@ -2388,7 +2607,11 @@ export declare enum VideoType {
|
|
2388
2607
|
* Video is a standard single video.
|
2389
2608
|
*/
|
2390
2609
|
VIDEO = "VIDEO",
|
2391
|
-
TV_PROGRAM = "TV_PROGRAM"
|
2610
|
+
TV_PROGRAM = "TV_PROGRAM",
|
2611
|
+
/**
|
2612
|
+
* Video object represents whole series, e.g. tv show.
|
2613
|
+
*/
|
2614
|
+
SERIES = "SERIES"
|
2392
2615
|
}
|
2393
2616
|
|
2394
2617
|
/**
|