@tivio/sdk-react 9.1.7 → 9.2.0-alpha.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.bak.md +578 -0
- package/README.md +11 -0
- package/README.md.bak +11 -0
- package/dist/index.d.ts +171 -19
- package/dist/index.js +1 -1
- package/dist/sdk-react.d.ts +184 -19
- package/package.json +1 -1
package/dist/sdk-react.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ComponentType } from 'react';
|
1
|
+
import type { ComponentType } from 'react';
|
2
2
|
import type dayjs from 'dayjs';
|
3
3
|
import { DocumentReference } from '@firebase/firestore-types';
|
4
4
|
import type duration from 'dayjs/plugin/duration';
|
@@ -480,6 +480,7 @@ declare interface ArticleDocumentSerialized {
|
|
480
480
|
monetizations?: TileMonetizationData[];
|
481
481
|
seriesPath?: string;
|
482
482
|
blocks: ArticleBlockField[] | undefined;
|
483
|
+
externalUrl?: string;
|
483
484
|
}
|
484
485
|
|
485
486
|
export declare interface ArticleMetadata {
|
@@ -492,6 +493,7 @@ export declare interface ArticleTileSpecificData {
|
|
492
493
|
assets?: AssetsField;
|
493
494
|
description?: Translation;
|
494
495
|
monetizations?: TileMonetizationData[];
|
496
|
+
externalUrl?: string;
|
495
497
|
}
|
496
498
|
|
497
499
|
/**
|
@@ -1062,10 +1064,9 @@ export declare const createPubSub: () => PubSub;
|
|
1062
1064
|
*/
|
1063
1065
|
export declare const createRemotePackageLoader: () => (secret: string, conf: InternalConfig, checkBundleCharCount?: boolean) => Promise<TivioBundle>;
|
1064
1066
|
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
export declare const createUseRemoteBundle: () => (conf: InternalConfig, checkBundleCharCount?: boolean) => RemoteBundleState;
|
1067
|
+
export declare const createTivio: () => (conf: SdkReactConfig) => Promise<RemoteBundleState>;
|
1068
|
+
|
1069
|
+
export declare const createUseRemoteBundle: () => (sdkReactConfig: SdkReactConfig, checkBundleCharCount?: boolean) => RemoteBundleState;
|
1069
1070
|
|
1070
1071
|
export declare interface CreateUserPayload {
|
1071
1072
|
displayName?: string;
|
@@ -1099,13 +1100,13 @@ export declare const CURRENCIES: string[];
|
|
1099
1100
|
* Three upper-case letters according to ISO-4217.
|
1100
1101
|
* @public
|
1101
1102
|
*/
|
1102
|
-
export declare type Currency = 'CZK' | 'EUR' | 'USD';
|
1103
|
+
export declare type Currency = 'CZK' | 'EUR' | 'USD' | 'PLN';
|
1103
1104
|
|
1104
1105
|
/**
|
1105
1106
|
* Necessary because keys in cloud function config cannot contain upper-case letters.
|
1106
1107
|
* Has to be in sync with {@link Currency}.
|
1107
1108
|
*/
|
1108
|
-
export declare type CurrencyLowerCase = 'czk' | 'eur' | 'usd';
|
1109
|
+
export declare type CurrencyLowerCase = 'czk' | 'eur' | 'usd' | 'pln';
|
1109
1110
|
|
1110
1111
|
export declare interface CurrentQuestion {
|
1111
1112
|
id: string;
|
@@ -1244,6 +1245,19 @@ export declare interface Customizations {
|
|
1244
1245
|
color: string;
|
1245
1246
|
};
|
1246
1247
|
};
|
1248
|
+
BackgroundBlurBanner?: {
|
1249
|
+
playVideoButton?: {
|
1250
|
+
backgroundColor?: string;
|
1251
|
+
color?: string;
|
1252
|
+
};
|
1253
|
+
logo?: {
|
1254
|
+
height: string;
|
1255
|
+
width: string;
|
1256
|
+
};
|
1257
|
+
description?: {
|
1258
|
+
fontSize?: string;
|
1259
|
+
};
|
1260
|
+
};
|
1247
1261
|
Row: {
|
1248
1262
|
/**
|
1249
1263
|
* Customizations of Banner component that is used as Row on Customer screen (e.g. WebBannerData)
|
@@ -2026,6 +2040,8 @@ export declare interface GetViewAnalyticsResponse {
|
|
2026
2040
|
|
2027
2041
|
export declare type GetViewsAnalyticsRequest = GetBaseAnalyticsRequest;
|
2028
2042
|
|
2043
|
+
export declare let globalSdkReactConfig: SdkReactConfig | undefined;
|
2044
|
+
|
2029
2045
|
/**
|
2030
2046
|
* @public
|
2031
2047
|
*/
|
@@ -3099,6 +3115,9 @@ export declare interface OrganizationSettingsField extends OrganizationResponsiv
|
|
3099
3115
|
tagModal?: {
|
3100
3116
|
hideTitle?: boolean;
|
3101
3117
|
};
|
3118
|
+
seriesModal?: {
|
3119
|
+
hideHeader?: boolean;
|
3120
|
+
};
|
3102
3121
|
};
|
3103
3122
|
voucher?: VoucherPageConfiguration;
|
3104
3123
|
}
|
@@ -3465,6 +3484,18 @@ export declare interface PlayerError {
|
|
3465
3484
|
timestamp: number;
|
3466
3485
|
}
|
3467
3486
|
|
3487
|
+
/**
|
3488
|
+
* @public
|
3489
|
+
*/
|
3490
|
+
export declare type PlayerEvent = {
|
3491
|
+
name: PlayerEventName;
|
3492
|
+
};
|
3493
|
+
|
3494
|
+
/**
|
3495
|
+
* @public
|
3496
|
+
*/
|
3497
|
+
export declare type PlayerEventName = `${PlayerWrapperEvents}`;
|
3498
|
+
|
3468
3499
|
/**
|
3469
3500
|
* @public
|
3470
3501
|
*/
|
@@ -3592,7 +3623,6 @@ export declare interface PlayerSourceInterface<T extends NonAdSourceType = NonAd
|
|
3592
3623
|
pauseReactions(): void;
|
3593
3624
|
correctStartPosition(): Promise<void | null>;
|
3594
3625
|
setCanSeek(canSeek: boolean): void;
|
3595
|
-
getOffset(): number;
|
3596
3626
|
getSeekingMatrixPreviewByTime(timeMs: number, offsetIndex?: number): SeekingMatrix | null;
|
3597
3627
|
originalOptions: Record<string, any>;
|
3598
3628
|
start?: Date;
|
@@ -3661,11 +3691,20 @@ export declare interface PlayerWrapper {
|
|
3661
3691
|
* Pause video
|
3662
3692
|
*/
|
3663
3693
|
pause: () => void;
|
3694
|
+
ad: AdSourceInterface | null;
|
3695
|
+
adMetadata: AdMetadata | null;
|
3696
|
+
adSegment: AdSegment | null;
|
3697
|
+
availableLanguages: LangCode[] | null;
|
3698
|
+
canReplay: boolean;
|
3699
|
+
currentSecondarySource: Video | null;
|
3700
|
+
currentTime: number;
|
3664
3701
|
/**
|
3665
3702
|
* Currently playing source
|
3666
3703
|
*/
|
3667
3704
|
source: PlayerSource | null;
|
3705
|
+
seekInterceptor: SeekInterceptor;
|
3668
3706
|
events: EmitterInterface;
|
3707
|
+
event: PlayerEvent | null;
|
3669
3708
|
/**
|
3670
3709
|
* Register a low level player that implements player methods, like play video, change volume, etc.
|
3671
3710
|
*/
|
@@ -3673,12 +3712,30 @@ export declare interface PlayerWrapper {
|
|
3673
3712
|
/**
|
3674
3713
|
* duration of current source in ms (both setter and getter)
|
3675
3714
|
*/
|
3676
|
-
durationMs: number
|
3715
|
+
durationMs: number;
|
3716
|
+
intro: {
|
3717
|
+
marker: any;
|
3718
|
+
skip: () => void;
|
3719
|
+
} | null;
|
3720
|
+
isBuffering: boolean;
|
3721
|
+
isCurrentTimeLive: boolean;
|
3722
|
+
isLiveSeekingEnabled: boolean;
|
3723
|
+
isMuted: boolean;
|
3677
3724
|
isPlaybackStarted?: boolean;
|
3678
3725
|
isPaused: boolean;
|
3679
3726
|
isPlaying: boolean;
|
3680
3727
|
isIdle: boolean;
|
3728
|
+
language: LangCode | null;
|
3729
|
+
nextRecommendedVideo: Video | null;
|
3730
|
+
prerollCheck: PrerollCheck;
|
3731
|
+
previousSource: PlayerSource | null;
|
3732
|
+
progress: number | null;
|
3733
|
+
progressMetadata: ProgressMetadata;
|
3734
|
+
requestedSource: PlayerSource | null;
|
3735
|
+
secondaryVideos: Video[] | null;
|
3681
3736
|
error: PlayerError | null;
|
3737
|
+
state: PlayerState;
|
3738
|
+
volume: number;
|
3682
3739
|
playbackError: PlayerError | null;
|
3683
3740
|
canPlay: boolean;
|
3684
3741
|
/**
|
@@ -3695,6 +3752,8 @@ export declare interface PlayerWrapper {
|
|
3695
3752
|
* set volume to value between 0,1
|
3696
3753
|
*/
|
3697
3754
|
setVolume: (volume: number) => void;
|
3755
|
+
changeLanguage: (langCode: LangCode) => Promise<void>;
|
3756
|
+
changeToFallbackSource: () => Promise<void>;
|
3698
3757
|
/**
|
3699
3758
|
* change volume by value between -1,1
|
3700
3759
|
*/
|
@@ -3702,7 +3761,52 @@ export declare interface PlayerWrapper {
|
|
3702
3761
|
setMuted: (muted: boolean) => void;
|
3703
3762
|
setCanPlay: (canPlay: boolean) => void;
|
3704
3763
|
toggleMuted: () => void;
|
3764
|
+
getQualities: () => Track[];
|
3765
|
+
playNativeImaAd: (url: string) => void;
|
3766
|
+
playSourceAfterAdsRun: () => void;
|
3767
|
+
putAd: (ad: AdSourceInterface) => void;
|
3768
|
+
putAdMetadata: (ad: AdSourceInterface) => void;
|
3769
|
+
reportLoadError: (error: Error) => void;
|
3770
|
+
reportStateChanged: (state: PlayerState) => void;
|
3771
|
+
reportTimeProgress: (ms: number) => void;
|
3772
|
+
reportPlaybackCancelled: () => void;
|
3773
|
+
reportPlaybackError: (error: Error) => void;
|
3774
|
+
reportPlaybackEnded: () => void;
|
3705
3775
|
resetErrors(): void;
|
3776
|
+
seekToPercent: (percentage: number) => void;
|
3777
|
+
seekToInternal: (ms: number) => void;
|
3778
|
+
seekToLive: () => void;
|
3779
|
+
seekToLiveInternal: () => void;
|
3780
|
+
setIsBuffering: (isBuffering: boolean) => void;
|
3781
|
+
setIsCasting: (isCasting: boolean) => void;
|
3782
|
+
skipAd: () => void;
|
3783
|
+
skipAllAds: () => void;
|
3784
|
+
switchSecondarySource: (activeVideoId?: string) => Promise<void>;
|
3785
|
+
}
|
3786
|
+
|
3787
|
+
/**
|
3788
|
+
* @public
|
3789
|
+
*/
|
3790
|
+
export declare enum PlayerWrapperEvents {
|
3791
|
+
'playback_cancelled' = "playback_cancelled",
|
3792
|
+
/**
|
3793
|
+
* Triggered when content video or ad finished playing until the end
|
3794
|
+
*/
|
3795
|
+
'playback_ended' = "playback_ended",
|
3796
|
+
/**
|
3797
|
+
* Triggered when both content video and all its associated ads finished playing until the end.
|
3798
|
+
* Or in case of postroll, when content video finished playing unit the end and all postroll
|
3799
|
+
* ads either finished / failed or were skipped.
|
3800
|
+
*/
|
3801
|
+
'video_unit_ended' = "video_unit_ended",
|
3802
|
+
/**
|
3803
|
+
* Pause was triggered
|
3804
|
+
*/
|
3805
|
+
'pause_triggered' = "pause_triggered",
|
3806
|
+
/**
|
3807
|
+
* Un-pause was triggered
|
3808
|
+
*/
|
3809
|
+
'unpause_triggered' = "unpause_triggered"
|
3706
3810
|
}
|
3707
3811
|
|
3708
3812
|
/**
|
@@ -3718,6 +3822,18 @@ export declare enum PlayerWrapperEventType {
|
|
3718
3822
|
*/
|
3719
3823
|
export declare type PlayerWrapperEventTypeType = `${PlayerWrapperEventType}`;
|
3720
3824
|
|
3825
|
+
/**
|
3826
|
+
* @public
|
3827
|
+
*/
|
3828
|
+
/**
|
3829
|
+
* A promise that ads will be loaded. Resolves to the first ad source,
|
3830
|
+
* other ads are linked to it via `ad.next` attribute.
|
3831
|
+
*
|
3832
|
+
* In case preroll is not configured or no ad
|
3833
|
+
* manages to load successfully, resolves to null.
|
3834
|
+
*/
|
3835
|
+
export declare type PrerollCheck = (source: PlayerSource) => Promise<AdSourceInterface | null>;
|
3836
|
+
|
3721
3837
|
export declare enum primaPlusMonetizationLevel {
|
3722
3838
|
light = "z7soJTA2dYSxnOOJw7B0",
|
3723
3839
|
premium = "kwfM0D7Vzv5wfLf5go8o",
|
@@ -3800,6 +3916,18 @@ export declare type ProfileSurvey = {
|
|
3800
3916
|
age?: AgeRange;
|
3801
3917
|
};
|
3802
3918
|
|
3919
|
+
/**
|
3920
|
+
* @public
|
3921
|
+
*/
|
3922
|
+
export declare interface ProgressMetadata {
|
3923
|
+
currentTimeMs: number;
|
3924
|
+
durationMs: number;
|
3925
|
+
percent: number;
|
3926
|
+
remainingMs: number;
|
3927
|
+
type: 'original' | 'cutout';
|
3928
|
+
cutout?: Cutout;
|
3929
|
+
}
|
3930
|
+
|
3803
3931
|
/**
|
3804
3932
|
* @public
|
3805
3933
|
*/
|
@@ -4435,10 +4563,11 @@ declare type Relationship = {
|
|
4435
4563
|
* @public
|
4436
4564
|
*/
|
4437
4565
|
export declare type RemoteBundleState = {
|
4438
|
-
config: InternalConfig;
|
4439
|
-
error: string | null;
|
4440
4566
|
state: 'loading' | 'error' | 'ready';
|
4441
|
-
|
4567
|
+
error: string | null;
|
4568
|
+
config: InternalConfig;
|
4569
|
+
settings: Settings;
|
4570
|
+
} & Omit<Partial<TivioJsBundleExposedApi>, 'createPlayerWrapper'> & Nullable<TivioBundle>;
|
4442
4571
|
|
4443
4572
|
export declare interface RemoteControlGenerateSourceResponse {
|
4444
4573
|
sessionId?: string;
|
@@ -4541,6 +4670,8 @@ export declare interface RenderConditionValue {
|
|
4541
4670
|
subscriptionRefs?: any[];
|
4542
4671
|
}
|
4543
4672
|
|
4673
|
+
export declare const renderWebPlayer: (container: HTMLElement, props: WebPlayerProps) => void;
|
4674
|
+
|
4544
4675
|
/**
|
4545
4676
|
* Make all attributes in given type required, non-nullable and defined.
|
4546
4677
|
* e.g. will make `{ attribute?: string | null }` to be `{ attribute: string }`
|
@@ -4765,6 +4896,14 @@ export declare type RowInScreen = {
|
|
4765
4896
|
* Setting for decided whether to hide title in the tiles/banners
|
4766
4897
|
*/
|
4767
4898
|
hideTitle?: boolean;
|
4899
|
+
/**
|
4900
|
+
* Link to external URL
|
4901
|
+
*/
|
4902
|
+
externalUrl?: string;
|
4903
|
+
/**
|
4904
|
+
* Title of Play button
|
4905
|
+
*/
|
4906
|
+
playButtonTitle?: Translation;
|
4768
4907
|
};
|
4769
4908
|
|
4770
4909
|
/**
|
@@ -5032,6 +5171,26 @@ export declare interface SeekingMatrixTemplate {
|
|
5032
5171
|
interval: number;
|
5033
5172
|
}
|
5034
5173
|
|
5174
|
+
export declare interface SeekInterceptionResult {
|
5175
|
+
position: number | null;
|
5176
|
+
didChangePosition: boolean;
|
5177
|
+
priority: number;
|
5178
|
+
}
|
5179
|
+
|
5180
|
+
/**
|
5181
|
+
* @public
|
5182
|
+
*/
|
5183
|
+
export declare interface SeekInterceptor {
|
5184
|
+
addInterceptor(interceptor: SeekInterceptorFunction, callback?: SeekInterceptorCallback): void;
|
5185
|
+
applyInterceptors(currentPosition: number, seekPosition: number): SeekInterceptionResult;
|
5186
|
+
callCallbacksAfterInterception(): void;
|
5187
|
+
removeInterceptor(interceptor: SeekInterceptorFunction): void;
|
5188
|
+
}
|
5189
|
+
|
5190
|
+
export declare type SeekInterceptorCallback = (requestedSeekPosition: number) => void;
|
5191
|
+
|
5192
|
+
export declare type SeekInterceptorFunction = (currentPosition: number, seekPosition: number) => SeekInterceptionResult;
|
5193
|
+
|
5035
5194
|
export declare enum SemanticDate {
|
5036
5195
|
YESTERDAY = "Yesterday",
|
5037
5196
|
TODAY = "Today",
|
@@ -5101,6 +5260,13 @@ export declare interface SetCustomClaimsRequest {
|
|
5101
5260
|
organizationId: string;
|
5102
5261
|
}
|
5103
5262
|
|
5263
|
+
export declare const setSdkReactConfig: (tivioConfig: SdkReactConfig) => void;
|
5264
|
+
|
5265
|
+
declare type Settings = {
|
5266
|
+
onSetUser: (handler: (userId: string, userPayload: UserPayload) => void) => void;
|
5267
|
+
setUser: (userId: string, userPayload: UserPayload) => void;
|
5268
|
+
};
|
5269
|
+
|
5104
5270
|
/**
|
5105
5271
|
* Used for entities, that can be global (e.g. asset presets, tag types).
|
5106
5272
|
* Non-global is stored under organizations (in sub-collection), and shown for organization's users and super-admin.
|
@@ -5822,7 +5988,7 @@ export declare type TivioGetters = {
|
|
5822
5988
|
* @returns {Promise<Monetization[] | undefined>} organization subscriptions or undefined if organization does not exists
|
5823
5989
|
*/
|
5824
5990
|
getSubscriptions: () => Promise<Monetization[] | undefined>;
|
5825
|
-
};
|
5991
|
+
} | null;
|
5826
5992
|
/**
|
5827
5993
|
* Get video by its id.
|
5828
5994
|
* @param videoId - video id
|
@@ -6028,7 +6194,7 @@ export declare type TivioJsBundleExposedApi = {
|
|
6028
6194
|
* @param id - player wrapper id
|
6029
6195
|
* @returns {Player} player wrapper instance
|
6030
6196
|
*/
|
6031
|
-
getPlayerWrapper: (id: string) =>
|
6197
|
+
getPlayerWrapper: (id: string) => PlayerWrapper;
|
6032
6198
|
/**
|
6033
6199
|
* Get tv channel by its id.
|
6034
6200
|
* @param tvChannelId - tv channel id
|
@@ -6064,18 +6230,17 @@ export declare interface TivioPlayerWrapper {
|
|
6064
6230
|
/**
|
6065
6231
|
* @public
|
6066
6232
|
*/
|
6067
|
-
export declare const TivioProvider: React_2.
|
6233
|
+
export declare const TivioProvider: (props: TivioProviderProps) => React_2.JSX.Element;
|
6068
6234
|
|
6069
6235
|
/**
|
6070
6236
|
* @public
|
6071
6237
|
*/
|
6072
|
-
export declare
|
6238
|
+
export declare interface TivioProviderProps extends React_2.PropsWithChildren {
|
6073
6239
|
/**
|
6074
6240
|
* This prop must be set only once and not change value afterwards
|
6075
6241
|
*/
|
6076
6242
|
conf: SdkReactConfig | undefined | null;
|
6077
|
-
|
6078
|
-
};
|
6243
|
+
}
|
6079
6244
|
|
6080
6245
|
/**
|
6081
6246
|
* @public
|
@@ -6104,7 +6269,7 @@ export declare type TivioReactBundle = {
|
|
6104
6269
|
internal: TivioInternalBundle;
|
6105
6270
|
analytics: TivioAnalytics;
|
6106
6271
|
destroy: () => Promise<void>;
|
6107
|
-
} & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
|
6272
|
+
} & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'> & Omit<Partial<TivioJsBundleExposedApi>, 'createPlayerWrapper'>;
|
6108
6273
|
|
6109
6274
|
/**
|
6110
6275
|
* @public
|