@tivio/sdk-js 2.3.2 → 2.3.3-beta.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +15 -1
- package/dist/index.d.ts +2359 -7
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +1457 -6
- package/dist/sdk-js.d.ts +2367 -0
- package/package.json +18 -22
- package/scripts/typesRollup.ts +28 -0
- package/dist/api.types.d.ts +0 -303
- package/dist/conf.d.ts +0 -59
- package/dist/conf.test.d.ts +0 -1
- package/dist/customPlayer.types.d.ts +0 -36
- package/dist/services/bundleLoader.d.ts +0 -29
- package/dist/services/bundleLoader.test.d.ts +0 -1
- package/dist/services/dependencyResolver.d.ts +0 -12
- package/dist/services/dependencyResolver.test.d.ts +0 -1
- package/dist/services/getProgramTimestamps.d.ts +0 -6
- package/dist/services/logger.d.ts +0 -28
- package/dist/services/logger.test.d.ts +0 -1
- package/dist/services/packageLoader.d.ts +0 -6
- package/dist/services/packageLoader.test.d.ts +0 -1
- package/dist/services/playerWrapper.d.ts +0 -28
- package/dist/services/playerWrapperInternal.d.ts +0 -28
- package/dist/services/settings.d.ts +0 -17
- package/dist/services/settings.test.d.ts +0 -1
- package/dist/setupTests.d.ts +0 -20
- package/dist/types.d.ts +0 -12
package/dist/sdk-js.d.ts
ADDED
@@ -0,0 +1,2367 @@
|
|
1
|
+
import { DocumentReference } from '@firebase/firestore-types';
|
2
|
+
import firebase from '@firebase/app-types';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @public
|
6
|
+
*/
|
7
|
+
declare type AdMetadata = {
|
8
|
+
type: 'ad';
|
9
|
+
subType: 'inserted' | 'original';
|
10
|
+
secondsToEnd: number;
|
11
|
+
/**
|
12
|
+
* null when ad is not skippable
|
13
|
+
*/
|
14
|
+
secondsToSkippable: number | null;
|
15
|
+
canTriggerSkip: boolean;
|
16
|
+
isSkippable: boolean;
|
17
|
+
order: number | null;
|
18
|
+
totalCount: number | null;
|
19
|
+
skip: () => void;
|
20
|
+
} | null;
|
21
|
+
|
22
|
+
declare interface AdSegment {
|
23
|
+
id: string;
|
24
|
+
/**
|
25
|
+
* @deprecated alias to secondsToEnd * 1000
|
26
|
+
*/
|
27
|
+
remainingMs: number;
|
28
|
+
secondsToEnd: number;
|
29
|
+
secondsToSkippable: number | null;
|
30
|
+
canSeek: boolean;
|
31
|
+
/**
|
32
|
+
* true if is skippable and skip countdown has passed
|
33
|
+
*/
|
34
|
+
canSkip: boolean;
|
35
|
+
/**
|
36
|
+
* true ad if is skippable after some skipDelayMs (if it is skippable, skipDelayMs is defined)
|
37
|
+
*/
|
38
|
+
isSkippable: boolean;
|
39
|
+
skip: () => any;
|
40
|
+
}
|
41
|
+
|
42
|
+
/**
|
43
|
+
* @public
|
44
|
+
*/
|
45
|
+
declare type AdSource = SourceBase & {
|
46
|
+
type: 'ad';
|
47
|
+
};
|
48
|
+
|
49
|
+
/**
|
50
|
+
* @public
|
51
|
+
*/
|
52
|
+
declare interface AdSourceInterface extends CommonSourceInterface<SourceType.ADVERTISEMENT> {
|
53
|
+
adType: AdType;
|
54
|
+
durationMs: number;
|
55
|
+
skipDelayMs: number | null;
|
56
|
+
/**
|
57
|
+
* true if is skippable and skip countdown has passed
|
58
|
+
*/
|
59
|
+
canSkip: boolean;
|
60
|
+
/**
|
61
|
+
* true ad if is skippable after some skipDelayMs (if it is skippable, skipDelayMs is defined)
|
62
|
+
*/
|
63
|
+
isSkippable: boolean;
|
64
|
+
isSkipped: boolean;
|
65
|
+
isPaused: boolean;
|
66
|
+
isMuted: boolean;
|
67
|
+
setIsPaused(isPaused: boolean): void;
|
68
|
+
/**
|
69
|
+
* Skip ad. Only works when canSkip is true
|
70
|
+
*/
|
71
|
+
skip: () => void;
|
72
|
+
/**
|
73
|
+
* Order in ad break (ad break is a group of ads played right after each other)
|
74
|
+
*/
|
75
|
+
order: number | null;
|
76
|
+
/**
|
77
|
+
* Total number of ads in ad break (ad break is a group of ads played right after each other)
|
78
|
+
*/
|
79
|
+
totalCount: number | null;
|
80
|
+
secondsToEnd: number;
|
81
|
+
secondsToSkippable: number | null;
|
82
|
+
provider?: VastProvider;
|
83
|
+
apiFramework: VastApiFramework | null;
|
84
|
+
parent: PlayerSourceInterface | null;
|
85
|
+
trackingContext: any | null;
|
86
|
+
resumeAd(): void;
|
87
|
+
pauseAd(): void;
|
88
|
+
muteAd(): void;
|
89
|
+
unmuteAd(): void;
|
90
|
+
skipAll(): void;
|
91
|
+
onRemainingTimeChanged(ms: number): void;
|
92
|
+
click(): void;
|
93
|
+
}
|
94
|
+
|
95
|
+
/**
|
96
|
+
* @public
|
97
|
+
*/
|
98
|
+
declare type AdType = 'playable' | 'metadata-only';
|
99
|
+
|
100
|
+
/**
|
101
|
+
* @public
|
102
|
+
*/
|
103
|
+
declare interface Advertisement extends RowItem {
|
104
|
+
id: string;
|
105
|
+
itemType: ROW_ITEM_TYPES.ADVERTISEMENT;
|
106
|
+
type?: string | null;
|
107
|
+
}
|
108
|
+
|
109
|
+
export declare type Api = RemoteBundleState;
|
110
|
+
|
111
|
+
/**
|
112
|
+
* @public
|
113
|
+
*/
|
114
|
+
declare interface Application extends RowItem {
|
115
|
+
id: string;
|
116
|
+
organizationId?: string;
|
117
|
+
itemType: ROW_ITEM_TYPES.APPLICATION;
|
118
|
+
name: string;
|
119
|
+
type: ApplicationType;
|
120
|
+
urlHandle: string;
|
121
|
+
applicationScreens: ApplicationScreenConfig[] | null;
|
122
|
+
screenConfigs: ScreenConfig[] | null;
|
123
|
+
logo: string | null;
|
124
|
+
cover: string | null;
|
125
|
+
videosCount: number | null;
|
126
|
+
organization?: Organization;
|
127
|
+
isEnabled: boolean;
|
128
|
+
}
|
129
|
+
|
130
|
+
/**
|
131
|
+
* @public
|
132
|
+
*/
|
133
|
+
declare interface ApplicationScreenConfig {
|
134
|
+
name: Translation;
|
135
|
+
order: number;
|
136
|
+
path: string;
|
137
|
+
screenConfig: ScreenConfig | null;
|
138
|
+
}
|
139
|
+
|
140
|
+
declare enum ApplicationType {
|
141
|
+
TIVIO_PRO = "TIVIO_PRO",
|
142
|
+
ORGANIZATION = "ORGANIZATION"
|
143
|
+
}
|
144
|
+
|
145
|
+
/**
|
146
|
+
* @public
|
147
|
+
*/
|
148
|
+
declare type ArrisDeviceInfo = {
|
149
|
+
type: 'arris';
|
150
|
+
model?: 'VIP1003' | 'VIP1113' | 'VIP5305';
|
151
|
+
};
|
152
|
+
|
153
|
+
/**
|
154
|
+
* @public
|
155
|
+
*/
|
156
|
+
declare interface Article extends RowItem, MonetizableItem, ReactableContent {
|
157
|
+
id: string;
|
158
|
+
itemType: ROW_ITEM_TYPES.ARTICLE;
|
159
|
+
blocks: ArticleBlock[];
|
160
|
+
cover: string;
|
161
|
+
organizationId?: string;
|
162
|
+
}
|
163
|
+
|
164
|
+
/**
|
165
|
+
* @public
|
166
|
+
*/
|
167
|
+
declare interface ArticleBlock {
|
168
|
+
id: string;
|
169
|
+
type: ArticleBlockType;
|
170
|
+
htmlContent?: string;
|
171
|
+
imageUrl?: string;
|
172
|
+
textContent?: string;
|
173
|
+
videoId?: string;
|
174
|
+
}
|
175
|
+
|
176
|
+
/**
|
177
|
+
* @public
|
178
|
+
*/
|
179
|
+
declare type ArticleBlockType = 'PARAGRAPH' | 'IMAGE' | 'VIDEO' | 'HEADING' | 'PAYWALL';
|
180
|
+
|
181
|
+
/**
|
182
|
+
* @public
|
183
|
+
*/
|
184
|
+
declare interface Asset {
|
185
|
+
background: string;
|
186
|
+
}
|
187
|
+
|
188
|
+
/**
|
189
|
+
* @public
|
190
|
+
*/
|
191
|
+
declare interface AssetsField<TAsset extends ScalableAsset = ScalableAsset> {
|
192
|
+
[assetName: string]: TAsset;
|
193
|
+
}
|
194
|
+
|
195
|
+
/**
|
196
|
+
* @public
|
197
|
+
*/
|
198
|
+
declare interface AvailableSeason {
|
199
|
+
seasonNumber: number;
|
200
|
+
seasonName?: string;
|
201
|
+
}
|
202
|
+
|
203
|
+
declare interface AvailableSeasonField {
|
204
|
+
seasonNumber: number;
|
205
|
+
seasonName?: Translation;
|
206
|
+
}
|
207
|
+
|
208
|
+
declare enum BannerItemComponent {
|
209
|
+
CLASSIC = "CLASSIC",
|
210
|
+
SPLIT = "SPLIT",
|
211
|
+
BACKGROUND = "BACKGROUND",
|
212
|
+
BACKGROUND_BLUR = "BACKGROUND_BLUR",
|
213
|
+
ORGANIZATION_BANNER = "ORGANIZATION_BANNER",
|
214
|
+
CAROUSEL = "CAROUSEL"
|
215
|
+
}
|
216
|
+
|
217
|
+
/**
|
218
|
+
* @public
|
219
|
+
*/
|
220
|
+
declare interface ChannelSourceInterface extends PlayerSourceInterface<SourceType.CHANNEL> {
|
221
|
+
tvChannelType: TvChannelType;
|
222
|
+
channelName: string;
|
223
|
+
programName?: string;
|
224
|
+
programDescription?: string;
|
225
|
+
from: Date;
|
226
|
+
to: Date;
|
227
|
+
poster: string | null;
|
228
|
+
tvMode: TvMode | 'live' | null;
|
229
|
+
}
|
230
|
+
|
231
|
+
/**
|
232
|
+
* @public
|
233
|
+
*/
|
234
|
+
declare interface ChannelSourceParams extends PlayerSourceParams<SourceType.CHANNEL> {
|
235
|
+
tvChannelType: TvChannelType;
|
236
|
+
channelName: string;
|
237
|
+
programName?: string;
|
238
|
+
programDescription?: string;
|
239
|
+
from: Date;
|
240
|
+
to: Date;
|
241
|
+
tvMode?: TvMode | 'live' | null;
|
242
|
+
}
|
243
|
+
|
244
|
+
/**
|
245
|
+
* @public
|
246
|
+
*/
|
247
|
+
declare type CmpConfig = 'default' | 'debug' | 'none';
|
248
|
+
|
249
|
+
/**
|
250
|
+
* TODO same name as core-js entity, not convenient
|
251
|
+
* @public
|
252
|
+
*/
|
253
|
+
declare type CommonSource = PlayerSource | AdSourceInterface;
|
254
|
+
|
255
|
+
/**
|
256
|
+
* Use this interface only for inheritance. Otherwise use {@link CommonSource}
|
257
|
+
* @public
|
258
|
+
*/
|
259
|
+
declare interface CommonSourceInterface<T extends SourceType = SourceType> {
|
260
|
+
type: T;
|
261
|
+
url: string;
|
262
|
+
name?: string;
|
263
|
+
description?: string;
|
264
|
+
currentTime: number;
|
265
|
+
event: any | null;
|
266
|
+
setEvent(event: any | null): void;
|
267
|
+
onTimeChanged(ms: number): void;
|
268
|
+
next: CommonSource | null;
|
269
|
+
canSeek: boolean;
|
270
|
+
hasNext: boolean;
|
271
|
+
isFinished: boolean;
|
272
|
+
setIsFinished(isFinished: boolean): void;
|
273
|
+
isStarted: boolean;
|
274
|
+
setIsStarted(isStarted: boolean): void;
|
275
|
+
autoplay?: boolean;
|
276
|
+
autoplayMuteFallback: boolean;
|
277
|
+
toLog(): any;
|
278
|
+
}
|
279
|
+
|
280
|
+
/**
|
281
|
+
* @public
|
282
|
+
*/
|
283
|
+
declare interface CommonSourceParams<T extends SourceType = SourceType> {
|
284
|
+
type: T;
|
285
|
+
url: string;
|
286
|
+
name?: string;
|
287
|
+
description?: string;
|
288
|
+
autoplay?: boolean;
|
289
|
+
}
|
290
|
+
|
291
|
+
export declare type Conf = Pick<InternalConf, 'bundleUrlOverride' | 'capabilitiesOptions' | 'deviceCapabilities' | 'enableSentry' | 'forceCloudFnResolver' | 'language' | 'logger' | 'secret' | 'verbose'>;
|
292
|
+
|
293
|
+
/**
|
294
|
+
* @public
|
295
|
+
*/
|
296
|
+
declare interface ConsumedAds {
|
297
|
+
chapterIds: Set<string>;
|
298
|
+
markerIds: Set<string>;
|
299
|
+
postroll: boolean;
|
300
|
+
/**
|
301
|
+
* TODO refactor
|
302
|
+
* true when preroll has been loaded (not when it was watched)
|
303
|
+
*/
|
304
|
+
preroll: boolean;
|
305
|
+
}
|
306
|
+
|
307
|
+
/**
|
308
|
+
* @public
|
309
|
+
*/
|
310
|
+
declare interface ContentAvailability {
|
311
|
+
from: Date;
|
312
|
+
to: Date | null;
|
313
|
+
manual: boolean;
|
314
|
+
}
|
315
|
+
|
316
|
+
/**
|
317
|
+
* @public
|
318
|
+
*/
|
319
|
+
declare type ContinuePosition = number | null | Promise<number | null>;
|
320
|
+
|
321
|
+
/**
|
322
|
+
* @param {PlayerInterfaceForPlayerWrapper} playerImplementation - player implementation
|
323
|
+
* @returns player wrapper instance
|
324
|
+
*/
|
325
|
+
export declare const createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => PlayerWrapper;
|
326
|
+
|
327
|
+
declare type CreatePlayerWrapperType = (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
|
328
|
+
|
329
|
+
/**
|
330
|
+
* Fetch & load CommonJS remote module.
|
331
|
+
*/
|
332
|
+
export declare const createRemotePackageLoader: () => (conf: InternalConf) => Promise<any>;
|
333
|
+
|
334
|
+
export declare const createTivio: () => (conf: Conf) => Promise<RemoteBundleState>;
|
335
|
+
|
336
|
+
/**
|
337
|
+
* @public
|
338
|
+
*/
|
339
|
+
declare type CreateUserWithEmailAndPassword = (email: string, password: string, username?: string, phoneNumber?: string, referralToken?: string) => Promise<string | null>;
|
340
|
+
|
341
|
+
/**
|
342
|
+
* Three upper-case letters according to ISO-4217.
|
343
|
+
* @public
|
344
|
+
*/
|
345
|
+
declare type Currency = 'CZK' | 'EUR' | 'USD';
|
346
|
+
|
347
|
+
/**
|
348
|
+
* @public
|
349
|
+
*/
|
350
|
+
declare enum CustomerId {
|
351
|
+
CESTMIR_STRAKATY = "CESTMIR_STRAKATY",
|
352
|
+
CNC = "CNC",
|
353
|
+
DVTV = "DVTV",
|
354
|
+
DVTV_DEV = "DVTV_DEV",
|
355
|
+
GARAZ = "GARAZ",
|
356
|
+
GRAPE = "GRAPE",
|
357
|
+
HODINA_DEJEPICHU = "HODINA_DEJEPICHU",
|
358
|
+
INVESTICNI_PRUVODCE = "INVESTICNI_PRUVODCE",
|
359
|
+
INVESTOREES = "INVESTOREES",
|
360
|
+
JOJ = "JOJ",
|
361
|
+
KLUCI_Z_PRAHY = "KLUCI_Z_PRAHY",
|
362
|
+
MALL = "MALL",
|
363
|
+
MEDIAR = "MEDIAR",
|
364
|
+
NANGU_DEV = "NANGU_DEV",
|
365
|
+
O2 = "O2",
|
366
|
+
OKTAGON = "OKTAGON",
|
367
|
+
ONDREJ_AUST = "ONDREJ_AUST",
|
368
|
+
ONDREJ_KOBERSKY = "ONDREJ_KOBERSKY",
|
369
|
+
REALTALK = "REALTALK",
|
370
|
+
STARMAX = "STARMAX",
|
371
|
+
STARGAZE = "STARGAZE",
|
372
|
+
STORYBOOK = "STORYBOOK",// dev
|
373
|
+
TIVIO = "TIVIO",
|
374
|
+
TIVIO_PRO = "TIVIO_PRO",
|
375
|
+
U_KULATEHO_STOLU = "U_KULATEHO_STOLU",
|
376
|
+
VIRTUAL_CHANNEL_VIDEOS = "VIRTUAL_CHANNEL_VIDEOS",
|
377
|
+
VOJTA_ZIZKA = "VOJTA_ZIZKA",
|
378
|
+
LIGA_NARUBY = "LIGA_NARUBY",
|
379
|
+
VIC_NEZ_SI_MYSLITE = "VIC_NEZ_SI_MYSLITE",
|
380
|
+
ZIMAK = "ZIMAK",
|
381
|
+
TYDENIK_HOROSKOPU = "TYDENIK_HOROSKOPU"
|
382
|
+
}
|
383
|
+
|
384
|
+
/**
|
385
|
+
* @public
|
386
|
+
*/
|
387
|
+
declare interface Cutout {
|
388
|
+
startMs: number;
|
389
|
+
endMs: number;
|
390
|
+
}
|
391
|
+
|
392
|
+
/**
|
393
|
+
* @public
|
394
|
+
*/
|
395
|
+
declare type DefaultOrderByField = 'created';
|
396
|
+
|
397
|
+
/**
|
398
|
+
* @public
|
399
|
+
*/
|
400
|
+
declare interface DetailedPrice {
|
401
|
+
amount: number;
|
402
|
+
currency: Currency;
|
403
|
+
frequency?: MONETIZATION_FREQUENCY;
|
404
|
+
durationDays?: number;
|
405
|
+
}
|
406
|
+
|
407
|
+
/**
|
408
|
+
* @public
|
409
|
+
*/
|
410
|
+
declare type DeviceInfo = ArrisDeviceInfo | ReactNativeDeviceInfo;
|
411
|
+
|
412
|
+
export declare type Disposer = () => void;
|
413
|
+
|
414
|
+
/**
|
415
|
+
* @public
|
416
|
+
*/
|
417
|
+
declare type Disposer_2 = () => void;
|
418
|
+
|
419
|
+
declare interface Drm {
|
420
|
+
encryption: VideoSourceEncryption;
|
421
|
+
/**
|
422
|
+
* Url to retrieve fairplay from.
|
423
|
+
*/
|
424
|
+
certificateUrl?: string;
|
425
|
+
/**
|
426
|
+
* Url to send license to.
|
427
|
+
*/
|
428
|
+
licenseUrl: string;
|
429
|
+
/**
|
430
|
+
* Headers with corresponding values to send to license server.
|
431
|
+
*/
|
432
|
+
licenseRequestHeaders: {
|
433
|
+
[key: string]: string;
|
434
|
+
};
|
435
|
+
}
|
436
|
+
|
437
|
+
/**
|
438
|
+
* @public
|
439
|
+
*/
|
440
|
+
declare interface Duration {
|
441
|
+
units: DurationUnits;
|
442
|
+
value: number;
|
443
|
+
}
|
444
|
+
|
445
|
+
/**
|
446
|
+
* @public
|
447
|
+
*/
|
448
|
+
declare enum DurationUnits {
|
449
|
+
DAY = "day",
|
450
|
+
MONTH = "month"
|
451
|
+
}
|
452
|
+
|
453
|
+
/**
|
454
|
+
* @public
|
455
|
+
*/
|
456
|
+
declare interface EmitterInterface {
|
457
|
+
isSupported: (even: string) => boolean;
|
458
|
+
addListener: <T = any>(event: string, cb: (value: T) => Empty_2) => void;
|
459
|
+
removeListener: <T = any>(event: string, cb: (value: T) => Empty_2) => void;
|
460
|
+
}
|
461
|
+
|
462
|
+
export declare type Empty = Promise<void> | void;
|
463
|
+
|
464
|
+
/**
|
465
|
+
* @public
|
466
|
+
*/
|
467
|
+
declare type Empty_2 = void | Promise<void> | undefined | Promise<undefined>;
|
468
|
+
|
469
|
+
export declare const fetchBundleViaResolver: (conf: InternalConf) => Promise<string>;
|
470
|
+
|
471
|
+
/**
|
472
|
+
* Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
|
473
|
+
* nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
474
|
+
*/
|
475
|
+
declare type FetchPackage = (url: string) => Promise<string>;
|
476
|
+
|
477
|
+
/**
|
478
|
+
* @public
|
479
|
+
*/
|
480
|
+
declare type FollowedOrganizationData = {
|
481
|
+
id: string;
|
482
|
+
name: string;
|
483
|
+
application: {
|
484
|
+
id: string;
|
485
|
+
urlHandle: string;
|
486
|
+
logo?: string;
|
487
|
+
logoLandscape?: string;
|
488
|
+
profilePhoto?: string;
|
489
|
+
};
|
490
|
+
};
|
491
|
+
|
492
|
+
/**
|
493
|
+
* @public
|
494
|
+
*/
|
495
|
+
declare type GeoBlocking = {
|
496
|
+
whitelist: Array<any>;
|
497
|
+
} | {
|
498
|
+
blacklist: Array<any>;
|
499
|
+
};
|
500
|
+
|
501
|
+
/**
|
502
|
+
* @public
|
503
|
+
*/
|
504
|
+
declare interface GetPurchasableMonetizationsOptions {
|
505
|
+
includeMonetizationsWithPurchaseDisabled: boolean;
|
506
|
+
}
|
507
|
+
|
508
|
+
declare interface GetSourceUrlResponse {
|
509
|
+
/**
|
510
|
+
* The resulting source url.
|
511
|
+
*/
|
512
|
+
url: string;
|
513
|
+
/**
|
514
|
+
* Which sources did client (or cloud function) has already tried out.
|
515
|
+
*/
|
516
|
+
sourceHistory: string[];
|
517
|
+
/**
|
518
|
+
* DRM configuration to {@link url} if source is encrypted.
|
519
|
+
*/
|
520
|
+
drm?: Drm;
|
521
|
+
/**
|
522
|
+
* See {@link SourcePlayMode} type.
|
523
|
+
*/
|
524
|
+
sourcePlayMode: SourcePlayMode;
|
525
|
+
/**
|
526
|
+
* Returns url to manifest with audio only chunks.
|
527
|
+
*/
|
528
|
+
audioOnly?: boolean;
|
529
|
+
}
|
530
|
+
|
531
|
+
declare type InternalConf = {
|
532
|
+
/**
|
533
|
+
* @private URL of remote code bundle to be fetched directly (without using resolver)
|
534
|
+
*/
|
535
|
+
bundleUrlOverride?: string;
|
536
|
+
/**
|
537
|
+
* Tells Tivio which technologies/protocols etc. is the device capable to play.
|
538
|
+
* If not provided, Tivio will try to guess it (based on the browser).
|
539
|
+
*/
|
540
|
+
deviceCapabilities?: PlayerCapability[];
|
541
|
+
/**
|
542
|
+
* Additional options for deviceCapabilities
|
543
|
+
*/
|
544
|
+
capabilitiesOptions?: {
|
545
|
+
/**
|
546
|
+
* Should the player prefer HTTP sources instead HTTPs if they are available.
|
547
|
+
* This can be used on platforms that support mixed content but do not support
|
548
|
+
* specific HTTPS certificates. (e.g. certificates from Letsencrypt not supported on LG TVs)
|
549
|
+
*/
|
550
|
+
preferHttp?: boolean;
|
551
|
+
};
|
552
|
+
secret: string;
|
553
|
+
resolverUrl: string;
|
554
|
+
logger?: Logger | null;
|
555
|
+
fetchPackage: FetchPackage;
|
556
|
+
language?: string;
|
557
|
+
sdkVersion: string;
|
558
|
+
/**
|
559
|
+
* Can force using bundle resolver method which doesn't depend on indexedDB (useful when some polyfill
|
560
|
+
* for indexedDB is used but indexedDB is not fully supported - it leads to situation where check for indexedDB
|
561
|
+
* presence passes but resolver fails anyway).
|
562
|
+
*/
|
563
|
+
forceCloudFnResolver?: boolean;
|
564
|
+
/**
|
565
|
+
* Can turn off Tivio's Sentry logging, defaults to true.
|
566
|
+
*/
|
567
|
+
enableSentry?: boolean;
|
568
|
+
/**
|
569
|
+
* Can turn on Tivio's console logging, defaults to false.
|
570
|
+
*/
|
571
|
+
verbose?: boolean;
|
572
|
+
};
|
573
|
+
|
574
|
+
/**
|
575
|
+
* Responsible for handling of all player wrapper methods (it's called through PlayerWrapper).
|
576
|
+
* Also handles state when player wrapper from core-js is not ready yet and situation when it becomes ready.
|
577
|
+
*/
|
578
|
+
declare class InternalPlayerWrapper implements TivioPlayerWrapper {
|
579
|
+
private playerImplementation;
|
580
|
+
private id;
|
581
|
+
corePlayerWrapperInstance: TivioPlayerWrapper | null;
|
582
|
+
listenersWaitingToRegister: {
|
583
|
+
eventType: PlayerWrapperEventTypeType;
|
584
|
+
listener: Listener;
|
585
|
+
}[];
|
586
|
+
constructor(playerImplementation: PlayerInterfaceForPlayerWrapper, id: string);
|
587
|
+
addEventListener(eventType: PlayerWrapperEventTypeType, listener: Listener): void;
|
588
|
+
reportError(error: Error): void;
|
589
|
+
reportPlaybackEnded(): void;
|
590
|
+
reportTimeProgress(ms: number): void;
|
591
|
+
seekTo(ms: number): void;
|
592
|
+
setSource(source: Source | null, calibrationId?: string): void;
|
593
|
+
/**
|
594
|
+
* Set instance of the real player wrapper (from core-js).
|
595
|
+
*
|
596
|
+
* @param createPlayerWrapper - create player wrapper method from core-js
|
597
|
+
*/
|
598
|
+
onPlayerWrapperReady(createPlayerWrapper: CreatePlayerWrapperType): void;
|
599
|
+
}
|
600
|
+
|
601
|
+
/**
|
602
|
+
* @public
|
603
|
+
*/
|
604
|
+
declare type ItemInRow = Tag | Video | TvChannel | Advertisement | Application | Article | Series;
|
605
|
+
|
606
|
+
/**
|
607
|
+
* Enum of all supported languages codes as in ISO 639-1
|
608
|
+
* @public
|
609
|
+
*/
|
610
|
+
declare enum LangCode {
|
611
|
+
CS = "cs",
|
612
|
+
DE = "de",
|
613
|
+
EN = "en",
|
614
|
+
FR = "fr",
|
615
|
+
IT = "it",
|
616
|
+
PL = "pl",
|
617
|
+
PT = "pt",
|
618
|
+
SK = "sk",
|
619
|
+
ES = "es",
|
620
|
+
HU = "hu"
|
621
|
+
}
|
622
|
+
|
623
|
+
/**
|
624
|
+
* @public
|
625
|
+
*/
|
626
|
+
declare interface LinkedVideo {
|
627
|
+
video: Video;
|
628
|
+
type: 'CUT' | 'TRAILER' | 'BONUS' | 'CHILD' | 'TEASER' | 'TASTING' | 'VIRTUAL_PROGRAM' | 'PIP';
|
629
|
+
}
|
630
|
+
|
631
|
+
/**
|
632
|
+
* @public
|
633
|
+
*/
|
634
|
+
declare interface LinkedVideoRaw {
|
635
|
+
videoRef: any;
|
636
|
+
type: LinkedVideo['type'];
|
637
|
+
}
|
638
|
+
|
639
|
+
/**
|
640
|
+
* @public
|
641
|
+
*/
|
642
|
+
declare type Listener = ListenerAdMetadata | ListenerMarkers;
|
643
|
+
|
644
|
+
/**
|
645
|
+
* @public
|
646
|
+
*/
|
647
|
+
declare type ListenerAdMetadata = (metadata: AdMetadata) => void;
|
648
|
+
|
649
|
+
/**
|
650
|
+
* @public
|
651
|
+
*/
|
652
|
+
declare type ListenerMarkers = (marker: Marker[] | null) => void;
|
653
|
+
|
654
|
+
/**
|
655
|
+
* Not supported yet, now it does pass-through only.
|
656
|
+
*
|
657
|
+
* @public
|
658
|
+
*/
|
659
|
+
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
|
+
|
667
|
+
declare interface Logger {
|
668
|
+
/** important messages */
|
669
|
+
warn(...data: LoggerArgs): void;
|
670
|
+
/** errors */
|
671
|
+
error(...data: LoggerArgs): void;
|
672
|
+
/** critical errors */
|
673
|
+
exception(...data: LoggerArgs): void;
|
674
|
+
/** metrics */
|
675
|
+
info(...data: LoggerArgs): void;
|
676
|
+
/** non-production messages */
|
677
|
+
debug(...data: LoggerArgs): void;
|
678
|
+
}
|
679
|
+
|
680
|
+
/**
|
681
|
+
* Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
|
682
|
+
* nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
683
|
+
*/
|
684
|
+
declare type LoggerArgs = any[];
|
685
|
+
|
686
|
+
/**
|
687
|
+
* @public
|
688
|
+
*/
|
689
|
+
declare interface Marker {
|
690
|
+
id: string;
|
691
|
+
from: Date;
|
692
|
+
to: Date;
|
693
|
+
count?: number;
|
694
|
+
fromMs?: number;
|
695
|
+
toMs?: number;
|
696
|
+
relativeFromMs: number;
|
697
|
+
relativeToMs: number;
|
698
|
+
type: 'AD' | 'AD_SEGMENT' | 'START' | 'END' | 'INTRO';
|
699
|
+
}
|
700
|
+
|
701
|
+
declare interface MonetizableItem {
|
702
|
+
/**
|
703
|
+
* Returns true if content is purchased (via transaction or subscription) or free.
|
704
|
+
*/
|
705
|
+
isPaid: boolean;
|
706
|
+
/**
|
707
|
+
* Gets the most relevant monetization for this content.
|
708
|
+
*/
|
709
|
+
purchasableMonetization: PurchasableMonetization | null;
|
710
|
+
/**
|
711
|
+
* Returns all transactions and subscriptions applied to this video.
|
712
|
+
* Transactions before subscriptions, sorted by price ascending.
|
713
|
+
*/
|
714
|
+
getPurchasableMonetizations(options?: GetPurchasableMonetizationsOptions): PurchasableMonetization[];
|
715
|
+
}
|
716
|
+
|
717
|
+
/**
|
718
|
+
* @public
|
719
|
+
*/
|
720
|
+
declare interface Monetization {
|
721
|
+
id: string;
|
722
|
+
type?: MonetizationType;
|
723
|
+
name?: string;
|
724
|
+
description?: string;
|
725
|
+
organizationId?: string;
|
726
|
+
}
|
727
|
+
|
728
|
+
/**
|
729
|
+
* @public
|
730
|
+
*/
|
731
|
+
declare enum MONETIZATION_DURATION {
|
732
|
+
UNLIMITED = -1,
|
733
|
+
DAY = 1,
|
734
|
+
WEEK = 7,
|
735
|
+
MONTH = 30,
|
736
|
+
HALF_YEAR = 183,
|
737
|
+
YEAR = 365
|
738
|
+
}
|
739
|
+
|
740
|
+
/**
|
741
|
+
* @public
|
742
|
+
*/
|
743
|
+
declare enum MONETIZATION_FREQUENCY {
|
744
|
+
ONE_TIME_PAYMENT = "ONE_TIME_PAYMENT",
|
745
|
+
DAILY = "DAILY",
|
746
|
+
WEEKLY = "WEEKLY",
|
747
|
+
MONTHLY = "MONTHLY",
|
748
|
+
HALF_ANNUALLY = "HALF_ANNUALLY",
|
749
|
+
ANNUALLY = "ANNUALLY"
|
750
|
+
}
|
751
|
+
|
752
|
+
/**
|
753
|
+
* @public
|
754
|
+
* @TODO change to enum
|
755
|
+
*/
|
756
|
+
declare type MonetizationType = 'advertisement' | 'transaction' | 'subscription' | 'display';
|
757
|
+
|
758
|
+
/**
|
759
|
+
* @public
|
760
|
+
*/
|
761
|
+
declare type NonAdSourceType = Exclude<SourceType, SourceType.ADVERTISEMENT>;
|
762
|
+
|
763
|
+
/**
|
764
|
+
* @public
|
765
|
+
*/
|
766
|
+
declare interface OrderBy<T = void> {
|
767
|
+
field: T extends void ? string : T;
|
768
|
+
directionStr?: OrderByDirection;
|
769
|
+
}
|
770
|
+
|
771
|
+
declare type OrderByDirection = 'desc' | 'asc';
|
772
|
+
|
773
|
+
/**
|
774
|
+
* @public
|
775
|
+
*/
|
776
|
+
declare interface Organization {
|
777
|
+
id: string;
|
778
|
+
userProfileConfiguration: any;
|
779
|
+
screenConfigs: ScreenConfig[];
|
780
|
+
logo: string | null;
|
781
|
+
logoLandscape: string | null;
|
782
|
+
organizationBanner: string | null;
|
783
|
+
profilePhoto: string | null;
|
784
|
+
}
|
785
|
+
|
786
|
+
/**
|
787
|
+
* If Tivio PlayerWrapper is an interception layer, it should allow the pass-through
|
788
|
+
* of not just Tivio source types but any other source types that the 3rd party app may be using.
|
789
|
+
*
|
790
|
+
* @public
|
791
|
+
*/
|
792
|
+
declare type OtherSource = SourceBase & StartAndContinuePosition & {
|
793
|
+
type: 'other';
|
794
|
+
};
|
795
|
+
|
796
|
+
/**
|
797
|
+
* @public
|
798
|
+
*/
|
799
|
+
declare type PaginationInterface<Entity> = {
|
800
|
+
items: Entity[];
|
801
|
+
fetchMore: () => void;
|
802
|
+
hasNextPage?: boolean;
|
803
|
+
loading?: boolean;
|
804
|
+
};
|
805
|
+
|
806
|
+
/**
|
807
|
+
* @public
|
808
|
+
*/
|
809
|
+
declare type PaginationOptions = Partial<{
|
810
|
+
limit: number;
|
811
|
+
noLimit: boolean;
|
812
|
+
noAutoFetch: boolean;
|
813
|
+
}>;
|
814
|
+
|
815
|
+
declare type PatreonUserAuth = {
|
816
|
+
access_token: string;
|
817
|
+
refresh_token: string;
|
818
|
+
expires_in: number;
|
819
|
+
token_type?: string;
|
820
|
+
scope?: string;
|
821
|
+
version?: string;
|
822
|
+
};
|
823
|
+
|
824
|
+
/**
|
825
|
+
* @public
|
826
|
+
*/
|
827
|
+
declare enum PLATFORM {
|
828
|
+
/**
|
829
|
+
* Includes tablets.
|
830
|
+
*/
|
831
|
+
MOBILE = "MOBILE",
|
832
|
+
WEB = "WEB",
|
833
|
+
TV = "TV",
|
834
|
+
/**
|
835
|
+
* @deprecated Used only in big query. In the future we'll migrate to undefined value and delete this.
|
836
|
+
*/
|
837
|
+
UNKNOWN = "unknown"
|
838
|
+
}
|
839
|
+
|
840
|
+
/**
|
841
|
+
* @public
|
842
|
+
*/
|
843
|
+
declare type Player = {
|
844
|
+
ad: any;
|
845
|
+
currentTime: any;
|
846
|
+
adSegment: any;
|
847
|
+
event: any;
|
848
|
+
events: any;
|
849
|
+
source: any;
|
850
|
+
state: any;
|
851
|
+
onPlaybackEnded: any;
|
852
|
+
onSourceChanged: any;
|
853
|
+
onStateChanged: any;
|
854
|
+
onTimeChanged: any;
|
855
|
+
pause: any;
|
856
|
+
play: any;
|
857
|
+
togglePlayPause: any;
|
858
|
+
register: any;
|
859
|
+
seekTo: any;
|
860
|
+
setVolume: any;
|
861
|
+
triggerEvent: any;
|
862
|
+
};
|
863
|
+
|
864
|
+
export declare interface PlayerCapability {
|
865
|
+
codec: 'h264' | 'h265';
|
866
|
+
encryption: 'fairplay' | 'none' | 'playready' | 'widevine';
|
867
|
+
protocol: 'dash' | 'hls';
|
868
|
+
}
|
869
|
+
|
870
|
+
/**
|
871
|
+
* @public
|
872
|
+
*/
|
873
|
+
declare interface PlayerCapability_2 {
|
874
|
+
codec: VideoSourceCodec;
|
875
|
+
encryption: VideoSourceEncryption;
|
876
|
+
protocol: VideoSourceProtocol;
|
877
|
+
}
|
878
|
+
|
879
|
+
/**
|
880
|
+
* @public
|
881
|
+
*/
|
882
|
+
declare type PlayerConfig = {
|
883
|
+
enabled?: boolean;
|
884
|
+
/**
|
885
|
+
* Some devices do not seek exactly
|
886
|
+
*
|
887
|
+
* e.g. on Arris if we request seek to position P, in reality it will seek to P -+5s
|
888
|
+
* e.g. on Arris if we request play from position P, in reality it will play from P -+5s
|
889
|
+
* (on Arris the error margin varies according to video format)
|
890
|
+
*/
|
891
|
+
acceptablePositionAnomalyMs?: number;
|
892
|
+
/**
|
893
|
+
* Stream delay config
|
894
|
+
*
|
895
|
+
* IP TV apps have TV program / TV channel streams delayed relative to the original
|
896
|
+
* video source. Therefore stream markers taken from the original video source
|
897
|
+
* are delayed relative to the TV stream seen by end users of the IP TV app.
|
898
|
+
*
|
899
|
+
* This delay must be corrected.
|
900
|
+
*/
|
901
|
+
streamDelayConfig?: {
|
902
|
+
/**
|
903
|
+
* ID of the delay config
|
904
|
+
*/
|
905
|
+
id: string;
|
906
|
+
};
|
907
|
+
ui?: {
|
908
|
+
/**
|
909
|
+
* ID of a DOM element inside which Tivio should display its player-related UI
|
910
|
+
* such as ad buttons. This DOM element is an anchor point for Tivio UI. Preferably
|
911
|
+
* it should be a <div/> element styled to cover the whole area of the video player
|
912
|
+
* and it should be positioned to be on top the existing player UI (e.g. via z-index).
|
913
|
+
*/
|
914
|
+
domAnchorId: string | null;
|
915
|
+
};
|
916
|
+
protocols?: {
|
917
|
+
mp4?: {
|
918
|
+
/**
|
919
|
+
* Set to false if player does not support MP4 files that require full file download
|
920
|
+
* (i.e. they do not support progressive MP4 download and therefore the whole file
|
921
|
+
* must be downloaded before playback can start)
|
922
|
+
*/
|
923
|
+
fullFileDownloadSupport?: boolean;
|
924
|
+
};
|
925
|
+
};
|
926
|
+
/**
|
927
|
+
* Ad service settings
|
928
|
+
*/
|
929
|
+
adService?: {
|
930
|
+
/**
|
931
|
+
* TIVIO AD SERVICE - can be used in websites and TV apps. Does not support VPAID
|
932
|
+
* IMA - can be used only in websites. Supports VAST 2, partially VAST 3, VAST 4, SIMID 1.0, OM SDK 1.3,
|
933
|
+
* VPAID 2 (HTML5) https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/compatibility
|
934
|
+
*/
|
935
|
+
name: 'IMA SDK' | 'TIVIO AD SERVICE';
|
936
|
+
};
|
937
|
+
};
|
938
|
+
|
939
|
+
declare interface PlayerError {
|
940
|
+
message: string;
|
941
|
+
}
|
942
|
+
|
943
|
+
/**
|
944
|
+
* @public
|
945
|
+
*/
|
946
|
+
declare interface PlayerInterface {
|
947
|
+
/**
|
948
|
+
* Pause playback
|
949
|
+
*/
|
950
|
+
pause: () => void;
|
951
|
+
/**
|
952
|
+
* Unpause playback
|
953
|
+
*/
|
954
|
+
play: () => Promise<void> | void;
|
955
|
+
/**
|
956
|
+
* Stop and close video
|
957
|
+
*/
|
958
|
+
stop: () => Promise<void> | void;
|
959
|
+
/**
|
960
|
+
* Seek to position in ms
|
961
|
+
*
|
962
|
+
* @param {number} ms - milliseconds relative to start of video (relative to 0 ms)
|
963
|
+
* or in case of TV programs relative to start of the program (relative to source.from ms)
|
964
|
+
*/
|
965
|
+
seekTo: (ms: number) => void;
|
966
|
+
/**
|
967
|
+
* Send this source to player. And either start playing it immediately if `source.autoplay` is true
|
968
|
+
* or just load it and keep it paused and ready to play if `source.autoplay` is false.
|
969
|
+
* If source is `null`, stop and close the player (this is the same as if `this.stop()` was called.)
|
970
|
+
*/
|
971
|
+
setSource: (source: CommonSource | null) => Promise<void> | void;
|
972
|
+
/**
|
973
|
+
* Set volume
|
974
|
+
*
|
975
|
+
* @param {number} volume value in [0,1]
|
976
|
+
*/
|
977
|
+
setVolume?: (volume: number) => void;
|
978
|
+
/**
|
979
|
+
* Mute the player volume
|
980
|
+
*/
|
981
|
+
mute?: () => void;
|
982
|
+
/**
|
983
|
+
* Unmute the player volume and restore it to the save level that was before it has been muted
|
984
|
+
*/
|
985
|
+
unmute?: () => void;
|
986
|
+
/**
|
987
|
+
* Sets native IMA ad URL which is then loaded and played on RN side
|
988
|
+
*/
|
989
|
+
setNativeImaAdUrl?: (url: string) => void;
|
990
|
+
/**
|
991
|
+
* Try to load and play native IMA ad using provided URL
|
992
|
+
*/
|
993
|
+
playNativeImaAd?: (url: string) => Promise<void>;
|
994
|
+
/**
|
995
|
+
* Get URL of native IMA ad which is currently playing
|
996
|
+
*/
|
997
|
+
getNativeImaAdUrl?: () => string | null;
|
998
|
+
lastQuality?: number | null;
|
999
|
+
getQualities?: () => Track[];
|
1000
|
+
/**
|
1001
|
+
* Attribute indicating that the video is to be played "inline"
|
1002
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#playsinline
|
1003
|
+
*/
|
1004
|
+
setPlaysInline?: (value: boolean) => void;
|
1005
|
+
setControlsList?: (value: string[]) => void;
|
1006
|
+
}
|
1007
|
+
|
1008
|
+
/**
|
1009
|
+
* @public
|
1010
|
+
*/
|
1011
|
+
declare interface PlayerInterfaceForPlayerWrapper {
|
1012
|
+
/**
|
1013
|
+
* @param {number} ms - milliseconds relative to start of video (relative to 0 ms)
|
1014
|
+
* or in case of TV programs relative to start of the program (relative to source.from ms)
|
1015
|
+
*/
|
1016
|
+
seekTo: (ms: number) => void;
|
1017
|
+
setSource: (source: Source | null) => void;
|
1018
|
+
}
|
1019
|
+
|
1020
|
+
/**
|
1021
|
+
* TODO same name as core-js entity, not convenient
|
1022
|
+
* @public
|
1023
|
+
*/
|
1024
|
+
declare type PlayerSource = VodTivioSourceInterface | VodExternalSourceInterface | ChannelSourceInterface | VirtualChannelSourceInterface;
|
1025
|
+
|
1026
|
+
/**
|
1027
|
+
* Use this interface only for inheritance. Otherwise use {@link PlayerSource}
|
1028
|
+
* @public
|
1029
|
+
*/
|
1030
|
+
declare interface PlayerSourceInterface<T extends NonAdSourceType = NonAdSourceType> extends CommonSourceInterface<T> {
|
1031
|
+
adSegment: AdSegment | null;
|
1032
|
+
consumedAds: ConsumedAds;
|
1033
|
+
currentMarker: any | null;
|
1034
|
+
drm?: Drm;
|
1035
|
+
markers: any[];
|
1036
|
+
setMarkers(markers: any[]): void;
|
1037
|
+
isMarkersLoaded: boolean;
|
1038
|
+
setOutroMarker(marker: any): void;
|
1039
|
+
durationMs: number;
|
1040
|
+
setDurationMs(ms: number): void;
|
1041
|
+
reset(): void;
|
1042
|
+
cutout: Cutout | null;
|
1043
|
+
destroy(): void;
|
1044
|
+
seekTo(ms: number): void;
|
1045
|
+
adMonetization: any;
|
1046
|
+
setAdMonetization(monetization: any): void;
|
1047
|
+
setInitialTime(ms: number): void;
|
1048
|
+
setContinueFromPosition(ms: ContinuePosition): void;
|
1049
|
+
isLive: boolean;
|
1050
|
+
sourcePlayMode?: SourcePlayMode;
|
1051
|
+
language?: LangCode | null;
|
1052
|
+
availableLanguages?: LangCode[] | null;
|
1053
|
+
startOrResumeReactions(): void;
|
1054
|
+
pauseReactions(): void;
|
1055
|
+
correctStartPosition(): Promise<void | null>;
|
1056
|
+
setCanSeek(canSeek: boolean): void;
|
1057
|
+
originalOptions: Record<string, any>;
|
1058
|
+
}
|
1059
|
+
|
1060
|
+
/**
|
1061
|
+
* @public
|
1062
|
+
*/
|
1063
|
+
declare interface PlayerSourceParams<T extends NonAdSourceType = NonAdSourceType> extends CommonSourceParams<T> {
|
1064
|
+
originalOptions?: Record<string, any>;
|
1065
|
+
continuePositionMs?: ContinuePosition;
|
1066
|
+
poster?: string | null;
|
1067
|
+
language?: LangCode | null;
|
1068
|
+
availableLanguages?: LangCode[] | null;
|
1069
|
+
sourcePlayMode: SourcePlayMode;
|
1070
|
+
}
|
1071
|
+
|
1072
|
+
/**
|
1073
|
+
* @public
|
1074
|
+
*/
|
1075
|
+
declare type PlayerState = 'idle' | 'playing' | 'paused';
|
1076
|
+
|
1077
|
+
/**
|
1078
|
+
* Player wrapper which instances are exposed to SDK user.
|
1079
|
+
*/
|
1080
|
+
declare class PlayerWrapper implements TivioPlayerWrapper {
|
1081
|
+
private internalPlayerWrapper;
|
1082
|
+
constructor(internalPlayerWrapper: InternalPlayerWrapper);
|
1083
|
+
addEventListener(eventType: 'adMetadata', listener: ListenerAdMetadata): void;
|
1084
|
+
addEventListener(eventType: 'markers', listener: ListenerMarkers): void;
|
1085
|
+
reportError: (error: Error) => void;
|
1086
|
+
reportPlaybackEnded: () => void;
|
1087
|
+
reportTimeProgress: (ms: number) => void;
|
1088
|
+
seekTo: (ms: number) => void;
|
1089
|
+
setSource: (source: Source | null, calibrationId?: string) => void;
|
1090
|
+
}
|
1091
|
+
|
1092
|
+
/**
|
1093
|
+
* @public
|
1094
|
+
*/
|
1095
|
+
declare interface PlayerWrapper_2 {
|
1096
|
+
/**
|
1097
|
+
* Report that playback of video has finished
|
1098
|
+
*/
|
1099
|
+
onPlaybackEnded: () => void;
|
1100
|
+
/**
|
1101
|
+
* Report video progress in milliseconds
|
1102
|
+
*/
|
1103
|
+
onTimeChanged: (ms: number) => void;
|
1104
|
+
/**
|
1105
|
+
* Report that video state changed
|
1106
|
+
*/
|
1107
|
+
onStateChanged: (state: PlayerState) => void;
|
1108
|
+
/**
|
1109
|
+
* Send source to Tivio
|
1110
|
+
*/
|
1111
|
+
onSourceChanged: (source: PlayerSource | null) => void;
|
1112
|
+
/**
|
1113
|
+
* Report that video failed to load (never started playing)
|
1114
|
+
*/
|
1115
|
+
onLoadError: (error: Error) => void;
|
1116
|
+
/**
|
1117
|
+
* Report that video failed during playback (successfully loaded and then failed, e.g. part of stream is invalid)
|
1118
|
+
*/
|
1119
|
+
onError: (error: Error) => void;
|
1120
|
+
/**
|
1121
|
+
* Unpause video
|
1122
|
+
*/
|
1123
|
+
play: () => void;
|
1124
|
+
/**
|
1125
|
+
* Pause video
|
1126
|
+
*/
|
1127
|
+
pause: () => void;
|
1128
|
+
/**
|
1129
|
+
* Currently playing source
|
1130
|
+
*/
|
1131
|
+
source: PlayerSource | null;
|
1132
|
+
events: EmitterInterface;
|
1133
|
+
/**
|
1134
|
+
* Register a low level player that implements player methods, like play video, change volume, etc.
|
1135
|
+
*/
|
1136
|
+
register: (playerInterface: PlayerInterface) => void;
|
1137
|
+
/**
|
1138
|
+
* duration of current source in ms (both setter and getter)
|
1139
|
+
*/
|
1140
|
+
durationMs: number | null;
|
1141
|
+
isPlaybackStarted?: boolean;
|
1142
|
+
isPaused: boolean;
|
1143
|
+
isPlaying: boolean;
|
1144
|
+
isIdle: boolean;
|
1145
|
+
error: PlayerError | null;
|
1146
|
+
/**
|
1147
|
+
* Replay the video that finished playback
|
1148
|
+
*/
|
1149
|
+
replay: () => void;
|
1150
|
+
/**
|
1151
|
+
* Retry to play a video that failed to start playing (e.g. due to a network error)
|
1152
|
+
*/
|
1153
|
+
retry: () => void;
|
1154
|
+
togglePlayPause: () => void;
|
1155
|
+
seekTo: (ms: number) => void;
|
1156
|
+
/**
|
1157
|
+
* set volume to value between 0,1
|
1158
|
+
*/
|
1159
|
+
setVolume: (volume: number) => void;
|
1160
|
+
/**
|
1161
|
+
* change volume by value between -1,1
|
1162
|
+
*/
|
1163
|
+
changeVolumeBy: (volume: number) => void;
|
1164
|
+
setMuted: (muted: boolean) => void;
|
1165
|
+
toggleMuted: () => void;
|
1166
|
+
getQualities: () => Track[];
|
1167
|
+
}
|
1168
|
+
|
1169
|
+
/**
|
1170
|
+
* @public
|
1171
|
+
*/
|
1172
|
+
declare enum PlayerWrapperEventType {
|
1173
|
+
adMetadata = "adMetadata",
|
1174
|
+
markers = "markers"
|
1175
|
+
}
|
1176
|
+
|
1177
|
+
/**
|
1178
|
+
* @public
|
1179
|
+
*/
|
1180
|
+
declare type PlayerWrapperEventTypeType = `${PlayerWrapperEventType}`;
|
1181
|
+
|
1182
|
+
/**
|
1183
|
+
* @public
|
1184
|
+
*/
|
1185
|
+
declare interface Promotion {
|
1186
|
+
duration?: Duration;
|
1187
|
+
price?: number;
|
1188
|
+
requiresPaymentAuthorization?: boolean;
|
1189
|
+
hideOtherSubscriptions?: boolean;
|
1190
|
+
}
|
1191
|
+
|
1192
|
+
/**
|
1193
|
+
* @public
|
1194
|
+
*/
|
1195
|
+
declare interface PurchasableMonetization extends Monetization {
|
1196
|
+
/**
|
1197
|
+
* Price before any discounts (e.g. promotions).
|
1198
|
+
*/
|
1199
|
+
originalPrice: number;
|
1200
|
+
/**
|
1201
|
+
* Final price (after discounts).
|
1202
|
+
*/
|
1203
|
+
price?: string | number;
|
1204
|
+
promotion: Promotion | null;
|
1205
|
+
frequency?: MONETIZATION_FREQUENCY;
|
1206
|
+
durationDays?: number;
|
1207
|
+
/**
|
1208
|
+
* Returns TRUE if subscription is purchased (and not expired) by user.
|
1209
|
+
* Returns TRUE if transaction is purchased (and not expired) for transactionItemId.
|
1210
|
+
* Returns FALSE otherwise.
|
1211
|
+
*
|
1212
|
+
* @param transactionItemId id of item for which transaction purchase is checked
|
1213
|
+
* @param transactionField type of item (video or tvChannel)
|
1214
|
+
*/
|
1215
|
+
isPurchased(transactionItemId?: string, transactionField?: 'videoId' | 'tvChannelId'): boolean;
|
1216
|
+
benefits?: Translation[];
|
1217
|
+
localizedBenefits?: string[];
|
1218
|
+
/**
|
1219
|
+
* Set to true for subscriptions which is not possible to buy - typically for historical subscriptions which users
|
1220
|
+
* still have bought but can't be purchased anymore.
|
1221
|
+
*/
|
1222
|
+
purchaseDisabled?: boolean;
|
1223
|
+
/**
|
1224
|
+
* When set to true, users can buy this monetization as a voucher (e.g. to send it as a gift to a friend).
|
1225
|
+
* If not set or set to false, users cannot buy it as a voucher.
|
1226
|
+
*/
|
1227
|
+
isPurchasableAsVoucher?: boolean;
|
1228
|
+
/**
|
1229
|
+
* Returns array of tag ids of monetization placements
|
1230
|
+
*/
|
1231
|
+
tagIds: string[];
|
1232
|
+
/**
|
1233
|
+
* When set to true, subscription is hidden in UI (e.g. in MonetizationSelectOverlay).
|
1234
|
+
*/
|
1235
|
+
subscriptionIsHidden?: boolean;
|
1236
|
+
}
|
1237
|
+
|
1238
|
+
/**
|
1239
|
+
* @public
|
1240
|
+
*/
|
1241
|
+
declare type Purchase = {
|
1242
|
+
/**
|
1243
|
+
* Timestamp of the purchase creation in milliseconds.
|
1244
|
+
*/
|
1245
|
+
created: number | null;
|
1246
|
+
/**
|
1247
|
+
* Email of the user who created the purchase manually.
|
1248
|
+
*/
|
1249
|
+
createdBy?: string;
|
1250
|
+
expirationDate: Date | null;
|
1251
|
+
gateway: PurchaseDocumentGateway | null;
|
1252
|
+
id: string;
|
1253
|
+
isExpired: boolean;
|
1254
|
+
/**
|
1255
|
+
* @deprecated isPurchased is ambiguous name. Now it means that purchase.status is "PAID".
|
1256
|
+
* So use purchase.status === PurchaseStatus.PAID instead.
|
1257
|
+
*/
|
1258
|
+
isPurchased: boolean;
|
1259
|
+
monetization: PurchaseMonetization | null;
|
1260
|
+
monetizationId: string | null;
|
1261
|
+
monetizationRef: any | null;
|
1262
|
+
status: PurchaseStatus | null;
|
1263
|
+
type: PurchaseType | null;
|
1264
|
+
/**
|
1265
|
+
* Timestamp of the last purchase status update in milliseconds.
|
1266
|
+
*/
|
1267
|
+
updated: number | null;
|
1268
|
+
videoId: string | null;
|
1269
|
+
videoRef: any | null;
|
1270
|
+
voucherId: string | null;
|
1271
|
+
isVoucherActivation?: boolean;
|
1272
|
+
rebalancingVideoRef?: any;
|
1273
|
+
};
|
1274
|
+
|
1275
|
+
/**
|
1276
|
+
* @public
|
1277
|
+
*/
|
1278
|
+
declare enum PurchaseDocumentGateway {
|
1279
|
+
'qerko' = "qerko",
|
1280
|
+
'oktagon' = "oktagon",
|
1281
|
+
'voucher' = "voucher",
|
1282
|
+
'comgate' = "comgate",
|
1283
|
+
'tivio' = "tivio",
|
1284
|
+
'patreon' = "patreon",
|
1285
|
+
'paypal' = "paypal",
|
1286
|
+
'unknown' = "unknown"
|
1287
|
+
}
|
1288
|
+
|
1289
|
+
/**
|
1290
|
+
* @public
|
1291
|
+
*/
|
1292
|
+
declare type PurchaseMonetization = {
|
1293
|
+
durationDays?: MONETIZATION_DURATION | number;
|
1294
|
+
currency?: Currency;
|
1295
|
+
price?: number;
|
1296
|
+
/**
|
1297
|
+
* Here are only transaction and subscription because purchasing of advertisement monetization doesn't make sense.
|
1298
|
+
*/
|
1299
|
+
type: 'transaction' | 'subscription';
|
1300
|
+
title?: string;
|
1301
|
+
frequency?: MONETIZATION_FREQUENCY | null;
|
1302
|
+
/**
|
1303
|
+
* If set purchase (subscription) activated by voucher will stay valid for this amount of seconds.
|
1304
|
+
* Otherwise purchase will be valid for one "monetization frequency" period.
|
1305
|
+
*/
|
1306
|
+
voucherPurchaseDuration?: number;
|
1307
|
+
};
|
1308
|
+
|
1309
|
+
/**
|
1310
|
+
* @public
|
1311
|
+
*/
|
1312
|
+
declare enum PurchaseStatus {
|
1313
|
+
NEW = "NEW",
|
1314
|
+
PAID = "PAID",
|
1315
|
+
CANCELLED = "CANCELLED",
|
1316
|
+
ERROR = "ERROR",
|
1317
|
+
/**
|
1318
|
+
* Used when purchase is terminated due to terms and conditions violation (e.g. restreaming).
|
1319
|
+
*/
|
1320
|
+
BLOCKED = "BLOCKED",
|
1321
|
+
/**
|
1322
|
+
* Used in subscription purchases when subscription is renewed.
|
1323
|
+
*/
|
1324
|
+
RENEWED = "RENEWED",
|
1325
|
+
/**
|
1326
|
+
* From NEW to ABORTED when user cancels purchase before payment or when payment fails.
|
1327
|
+
*/
|
1328
|
+
ABORTED = "ABORTED",
|
1329
|
+
/**
|
1330
|
+
* When user manually cancels purchase but still has access to content until expiration date.
|
1331
|
+
*/
|
1332
|
+
CANCELLING = "CANCELLING",
|
1333
|
+
/**
|
1334
|
+
* From PAID to EXPIRED when payment fails to renew subscription.
|
1335
|
+
*/
|
1336
|
+
EXPIRED = "EXPIRED"
|
1337
|
+
}
|
1338
|
+
|
1339
|
+
/**
|
1340
|
+
* Purchase is a purchase of one video (transaction type) purchase of subscription or voucher.
|
1341
|
+
*
|
1342
|
+
* @public
|
1343
|
+
*/
|
1344
|
+
declare type PurchaseType = 'transaction' | 'subscription' | 'voucher';
|
1345
|
+
|
1346
|
+
/**
|
1347
|
+
* @public
|
1348
|
+
*/
|
1349
|
+
declare interface ReactableContent {
|
1350
|
+
path: string;
|
1351
|
+
reactions: {
|
1352
|
+
[key in ReactionEnum]?: number;
|
1353
|
+
} | null;
|
1354
|
+
updateReactionCount: (reaction: ReactionEnum, newCount: number) => void;
|
1355
|
+
}
|
1356
|
+
|
1357
|
+
/**
|
1358
|
+
* @public
|
1359
|
+
*/
|
1360
|
+
declare enum ReactionEnum {
|
1361
|
+
LIKE = "LIKE",
|
1362
|
+
DISLIKE = "DISLIKE",
|
1363
|
+
LOVE = "LOVE",
|
1364
|
+
HAHA = "HAHA",
|
1365
|
+
WOW = "WOW",
|
1366
|
+
SAD = "SAD",
|
1367
|
+
ANGRY = "ANGRY",
|
1368
|
+
CARE = "CARE",
|
1369
|
+
SUPPORT = "SUPPORT",
|
1370
|
+
PRAY = "PRAY",
|
1371
|
+
THINK = "THINK",
|
1372
|
+
CELEBRATE = "CELEBRATE",
|
1373
|
+
THANKFUL = "THANKFUL",
|
1374
|
+
LAUGH = "LAUGH",
|
1375
|
+
INSPIRED = "INSPIRED",
|
1376
|
+
AWW = "AWW"
|
1377
|
+
}
|
1378
|
+
|
1379
|
+
/**
|
1380
|
+
* @public
|
1381
|
+
*/
|
1382
|
+
declare type ReactNativeDeviceInfo = {
|
1383
|
+
type: 'react-native';
|
1384
|
+
/**
|
1385
|
+
* Type values defined according to {@link OperatingSystem} from `detect-browser` package for convenience.
|
1386
|
+
*/
|
1387
|
+
os?: 'iOS' | 'Android OS';
|
1388
|
+
osVersion: string;
|
1389
|
+
platform: PLATFORM;
|
1390
|
+
isTablet?: boolean;
|
1391
|
+
};
|
1392
|
+
|
1393
|
+
export declare type RemoteBundleState = {
|
1394
|
+
state: 'loading' | 'error' | 'ready';
|
1395
|
+
error: string | null;
|
1396
|
+
conf: InternalConf;
|
1397
|
+
settings: Settings;
|
1398
|
+
} & Omit<Partial<TivioJsBundleExposedApi>, 'createPlayerWrapper'>;
|
1399
|
+
|
1400
|
+
export declare type RemoteProviderProps = {
|
1401
|
+
language?: string;
|
1402
|
+
};
|
1403
|
+
|
1404
|
+
/**
|
1405
|
+
* @public
|
1406
|
+
*/
|
1407
|
+
declare interface Row {
|
1408
|
+
id: string;
|
1409
|
+
rowId: string;
|
1410
|
+
name: string;
|
1411
|
+
description?: string;
|
1412
|
+
assets: AssetsField;
|
1413
|
+
type: ScreenRowType;
|
1414
|
+
isLiveRow: boolean;
|
1415
|
+
tiles: PaginationInterface<ItemInRow>;
|
1416
|
+
numberOfLines?: number;
|
1417
|
+
monetizations?: {
|
1418
|
+
monetizationRef: any;
|
1419
|
+
}[];
|
1420
|
+
rowComponent: RowComponent.ROW | RowComponent.BANNER;
|
1421
|
+
itemComponent: RowItemComponent | BannerItemComponent;
|
1422
|
+
organizationId?: string;
|
1423
|
+
}
|
1424
|
+
|
1425
|
+
/**
|
1426
|
+
* @public
|
1427
|
+
*/
|
1428
|
+
declare enum ROW_ITEM_TYPES {
|
1429
|
+
APPLICATION = "APPLICATION",
|
1430
|
+
VIDEO = "VIDEO",
|
1431
|
+
TAG = "TAG",
|
1432
|
+
TV_CHANNEL = "TV_CHANNEL",
|
1433
|
+
ADVERTISEMENT = "ADVERTISEMENT",
|
1434
|
+
ARTICLE = "ARTICLE",
|
1435
|
+
SERIES = "SERIES"
|
1436
|
+
}
|
1437
|
+
|
1438
|
+
/**
|
1439
|
+
* @public
|
1440
|
+
*/
|
1441
|
+
declare enum RowComponent {
|
1442
|
+
ROW = "ROW",
|
1443
|
+
BANNER = "BANNER"
|
1444
|
+
}
|
1445
|
+
|
1446
|
+
/**
|
1447
|
+
* @public
|
1448
|
+
*/
|
1449
|
+
declare interface RowItem extends RowItemAssets {
|
1450
|
+
created?: Date;
|
1451
|
+
itemType: ROW_ITEM_TYPES;
|
1452
|
+
name?: string;
|
1453
|
+
description?: string;
|
1454
|
+
assets: AssetsField | null;
|
1455
|
+
application: RowItemApplicationData | null;
|
1456
|
+
feedVisible?: boolean;
|
1457
|
+
}
|
1458
|
+
|
1459
|
+
/**
|
1460
|
+
* @public
|
1461
|
+
*/
|
1462
|
+
declare interface RowItemApplicationData {
|
1463
|
+
name: string;
|
1464
|
+
logo?: string | null;
|
1465
|
+
logoLandscape?: string | null;
|
1466
|
+
profilePhoto?: string | null;
|
1467
|
+
urlHandle: string;
|
1468
|
+
organizationId?: string | null;
|
1469
|
+
}
|
1470
|
+
|
1471
|
+
/**
|
1472
|
+
* @public
|
1473
|
+
*/
|
1474
|
+
declare interface RowItemAssets {
|
1475
|
+
landscape?: string | null;
|
1476
|
+
portrait?: string | null;
|
1477
|
+
circled?: string | null;
|
1478
|
+
square?: string | null;
|
1479
|
+
banner?: string | null;
|
1480
|
+
bannerMobile?: string | null;
|
1481
|
+
}
|
1482
|
+
|
1483
|
+
/**
|
1484
|
+
* @public
|
1485
|
+
*/
|
1486
|
+
declare enum RowItemComponent {
|
1487
|
+
ROW_ITEM_PORTRAIT = "ROW_ITEM_PORTRAIT",
|
1488
|
+
ROW_ITEM_LANDSCAPE = "ROW_ITEM_LANDSCAPE",
|
1489
|
+
ROW_ITEM_SQUARE = "ROW_ITEM_SQUARE",
|
1490
|
+
ROW_ITEM_CREATORS_SQUARE = "ROW_ITEM_CREATORS_SQUARE",
|
1491
|
+
ROW_ITEM_CREATORS_LANDSCAPE = "ROW_ITEM_CREATORS_LANDSCAPE",
|
1492
|
+
ROW_ITEM_CIRCLED = "ROW_ITEM_CIRCLED",
|
1493
|
+
ROW_ITEM_HIGHLIGHTED = "ROW_ITEM_HIGHLIGHTED",
|
1494
|
+
ROW_ITEM_PLAIN = "ROW_ITEM_PLAIN"
|
1495
|
+
}
|
1496
|
+
|
1497
|
+
/**
|
1498
|
+
* @public
|
1499
|
+
*/
|
1500
|
+
declare type ScalableAsset = {
|
1501
|
+
'@1': Asset;
|
1502
|
+
'@2'?: Asset;
|
1503
|
+
'@3'?: Asset;
|
1504
|
+
};
|
1505
|
+
|
1506
|
+
/**
|
1507
|
+
* @public
|
1508
|
+
*/
|
1509
|
+
declare type ScreenConfig = {
|
1510
|
+
id: string;
|
1511
|
+
name: string;
|
1512
|
+
route?: string;
|
1513
|
+
isHiddenFromMenu?: boolean;
|
1514
|
+
showForUserProfileType?: {
|
1515
|
+
kids: boolean;
|
1516
|
+
adults: boolean;
|
1517
|
+
};
|
1518
|
+
monetizationAccessIds?: string[];
|
1519
|
+
};
|
1520
|
+
|
1521
|
+
/**
|
1522
|
+
* @public
|
1523
|
+
*/
|
1524
|
+
declare type ScreenRowType = 'filter' | 'custom' | 'continueToWatch' | 'favourites' | 'topWatched' | 'applications';
|
1525
|
+
|
1526
|
+
/**
|
1527
|
+
* @public
|
1528
|
+
*/
|
1529
|
+
declare interface Series extends RowItem, MonetizableItem, ReactableContent {
|
1530
|
+
id: string;
|
1531
|
+
itemType: ROW_ITEM_TYPES.SERIES;
|
1532
|
+
cover: string;
|
1533
|
+
organizationId?: string;
|
1534
|
+
/**
|
1535
|
+
* Only used for non migrated series
|
1536
|
+
*/
|
1537
|
+
originalSeriesTagRef?: any;
|
1538
|
+
ref: DocumentReference<any>;
|
1539
|
+
availableSeasons: AvailableSeason[];
|
1540
|
+
actors?: DocumentReference<any>[];
|
1541
|
+
}
|
1542
|
+
|
1543
|
+
declare type Settings = {
|
1544
|
+
onSetUser: (handler: (userId: string, userPayload: unknown) => void) => void;
|
1545
|
+
setUser: (userId: string, userPayload: unknown) => void;
|
1546
|
+
};
|
1547
|
+
|
1548
|
+
/**
|
1549
|
+
* @public
|
1550
|
+
*/
|
1551
|
+
declare type Source = TvProgramSource | TivioVodSource | AdSource | OtherSource | LiveTvChannelSource;
|
1552
|
+
|
1553
|
+
/**
|
1554
|
+
* @public
|
1555
|
+
*/
|
1556
|
+
declare type SourceBase = {
|
1557
|
+
/**
|
1558
|
+
* Tivio SDK users may use pretty complicated source objects in their existing code and if Tivio player
|
1559
|
+
* is an interception layer, it should allow them to pass through any type of object.
|
1560
|
+
*/
|
1561
|
+
additionalPayload?: Record<string, any>;
|
1562
|
+
/**
|
1563
|
+
* Source type.
|
1564
|
+
*/
|
1565
|
+
type: 'ad' | 'live_tv_channel' | 'other' | 'tivio_vod' | 'tv_program';
|
1566
|
+
/**
|
1567
|
+
* URI to play.
|
1568
|
+
*/
|
1569
|
+
uri: string;
|
1570
|
+
};
|
1571
|
+
|
1572
|
+
/**
|
1573
|
+
* Based on this value player will change how the source is played. This, for example, affects whether source:
|
1574
|
+
* - will be seekable or not
|
1575
|
+
* - duration will be dynamically updated as time goes on
|
1576
|
+
* - live button will be shown in ui
|
1577
|
+
*/
|
1578
|
+
declare enum SourcePlayMode {
|
1579
|
+
ON_DEMAND = "ON_DEMAND",
|
1580
|
+
LIVE = "LIVE",
|
1581
|
+
/**
|
1582
|
+
* ON_DEMAND and LIVE at the same time.
|
1583
|
+
*/
|
1584
|
+
HYBRID = "HYBRID"
|
1585
|
+
}
|
1586
|
+
|
1587
|
+
/**
|
1588
|
+
* @public
|
1589
|
+
*/
|
1590
|
+
declare enum SourceType {
|
1591
|
+
ADVERTISEMENT = "ad",
|
1592
|
+
CHANNEL = "channel",
|
1593
|
+
VOD_TIVIO = "vod_tivio",
|
1594
|
+
VOD_EXTERNAL = "vod_external"
|
1595
|
+
}
|
1596
|
+
|
1597
|
+
/**
|
1598
|
+
* @public
|
1599
|
+
*/
|
1600
|
+
declare type StartAndContinuePosition = {
|
1601
|
+
/**
|
1602
|
+
* Relative from stream start, in ms.
|
1603
|
+
*
|
1604
|
+
* On input to Tivio either `startFromPosition` or `continueFromPosition` must always be provided.
|
1605
|
+
*
|
1606
|
+
* On output from Tivio it is always defined. Tivio can change this value.
|
1607
|
+
* (e.g. in order to fix start position of a TV program)
|
1608
|
+
*/
|
1609
|
+
startFromPosition?: number;
|
1610
|
+
/**
|
1611
|
+
* Relative from stream start, in ms.
|
1612
|
+
*
|
1613
|
+
* On input to Tivio either `startFromPosition` or `continueFromPosition` must always be provided.
|
1614
|
+
*
|
1615
|
+
* If provided, tivio will not correct it and will send this value back in startFromPosition.
|
1616
|
+
* If provided, startFromPosition is ignored.
|
1617
|
+
*/
|
1618
|
+
continueFromPosition?: number;
|
1619
|
+
};
|
1620
|
+
|
1621
|
+
/**
|
1622
|
+
* @public
|
1623
|
+
*/
|
1624
|
+
declare interface StorageManager_2 {
|
1625
|
+
getItem(key: string): string | null | Promise<string | null>;
|
1626
|
+
setItem(key: string, value: string): void | Promise<void>;
|
1627
|
+
removeItem(key: string): void | Promise<void>;
|
1628
|
+
}
|
1629
|
+
|
1630
|
+
/**
|
1631
|
+
* @public
|
1632
|
+
*/
|
1633
|
+
declare type SubscribeToItemsInRow = (rowId: string, cb: (error: Error | null, data: PaginationInterface<ItemInRow> | null) => void, options?: SubscribeToItemsInRowOptions) => Disposer_2;
|
1634
|
+
|
1635
|
+
/**
|
1636
|
+
* @public
|
1637
|
+
*/
|
1638
|
+
declare type SubscribeToItemsInRowOptions = Partial<{
|
1639
|
+
fetchTags: boolean;
|
1640
|
+
orderBy?: OrderBy<'defaultName' | DefaultOrderByField>[];
|
1641
|
+
where?: WhereFilter[];
|
1642
|
+
}> & PaginationOptions;
|
1643
|
+
|
1644
|
+
/**
|
1645
|
+
* @public
|
1646
|
+
*/
|
1647
|
+
declare type SubscribeToRowsInScreen = (screenId: string, cb: (error: Error | null, data: PaginationInterface<Row> | null) => void, options?: PaginationOptions) => Disposer_2;
|
1648
|
+
|
1649
|
+
/**
|
1650
|
+
* @public
|
1651
|
+
*/
|
1652
|
+
declare type SubscribeToTaggedVideos = (tagIds: string[], cb: (error: Error | null, data: PaginationInterface<Video> | null) => void, options?: SubscribeToTaggedVideosOptions) => Disposer_2;
|
1653
|
+
|
1654
|
+
/**
|
1655
|
+
* @public
|
1656
|
+
*/
|
1657
|
+
declare type SubscribeToTaggedVideosOptions = Omit<SubscribeToItemsInRowOptions, 'orderBy'> & {
|
1658
|
+
orderBy?: OrderBy<TaggedVideosOrderByField>[];
|
1659
|
+
};
|
1660
|
+
|
1661
|
+
/**
|
1662
|
+
* @public
|
1663
|
+
*/
|
1664
|
+
declare interface Tag extends RowItem {
|
1665
|
+
id: string;
|
1666
|
+
itemType: ROW_ITEM_TYPES.TAG;
|
1667
|
+
tagId: string;
|
1668
|
+
type?: string | null;
|
1669
|
+
metadata?: TagMetadataField[];
|
1670
|
+
color?: string;
|
1671
|
+
detailBanner?: string;
|
1672
|
+
availableSeasons?: AvailableSeason[];
|
1673
|
+
isFavorite: boolean;
|
1674
|
+
addToFavorites: () => void;
|
1675
|
+
removeFromFavorites: () => void;
|
1676
|
+
cover: string;
|
1677
|
+
getApplicationName: () => string | undefined;
|
1678
|
+
seriesRef?: DocumentReference<any>;
|
1679
|
+
fetchData: () => Promise<void>;
|
1680
|
+
getSeriesEntity: (path: string) => Promise<Series>;
|
1681
|
+
ref: DocumentReference<any>;
|
1682
|
+
seriesEntity: Series | null;
|
1683
|
+
}
|
1684
|
+
|
1685
|
+
declare interface TagAvailableSeasonsFieldType extends TagMetadataFieldDefinition {
|
1686
|
+
type: TagMetadataFieldType.AVAILABLE_SEASONS;
|
1687
|
+
value: AvailableSeasonField[];
|
1688
|
+
}
|
1689
|
+
|
1690
|
+
declare interface TagBooleanFieldType extends TagMetadataFieldDefinition {
|
1691
|
+
type: TagMetadataFieldType.BOOLEAN;
|
1692
|
+
value: boolean;
|
1693
|
+
}
|
1694
|
+
|
1695
|
+
/**
|
1696
|
+
* @public
|
1697
|
+
*/
|
1698
|
+
declare type TaggedVideosOrderByField = 'seasonNumber' | 'episodeNumber' | 'contentType' | DefaultOrderByField;
|
1699
|
+
|
1700
|
+
declare type TagMetadataField = TagStringFieldType | TagNumberFieldType | TagBooleanFieldType | TagTranslationFieldType | TagAvailableSeasonsFieldType | TagOrganizationRefFieldType;
|
1701
|
+
|
1702
|
+
declare interface TagMetadataFieldDefinition {
|
1703
|
+
key: string;
|
1704
|
+
type: TagMetadataFieldType;
|
1705
|
+
}
|
1706
|
+
|
1707
|
+
declare enum TagMetadataFieldType {
|
1708
|
+
STRING = "STRING",
|
1709
|
+
TRANSLATION = "TRANSLATION",
|
1710
|
+
NUMBER = "NUMBER",
|
1711
|
+
BOOLEAN = "BOOLEAN",
|
1712
|
+
AVAILABLE_SEASONS = "AVAILABLE_SEASONS",
|
1713
|
+
ORGANIZATION_REF = "ORGANIZATION_REF"
|
1714
|
+
}
|
1715
|
+
|
1716
|
+
declare interface TagNumberFieldType extends TagMetadataFieldDefinition {
|
1717
|
+
type: TagMetadataFieldType.NUMBER;
|
1718
|
+
value: number;
|
1719
|
+
}
|
1720
|
+
|
1721
|
+
declare interface TagOrganizationRefFieldType extends TagMetadataFieldDefinition {
|
1722
|
+
type: TagMetadataFieldType.ORGANIZATION_REF;
|
1723
|
+
value: DocumentReference<any>;
|
1724
|
+
}
|
1725
|
+
|
1726
|
+
declare interface TagStringFieldType extends TagMetadataFieldDefinition {
|
1727
|
+
type: TagMetadataFieldType.STRING;
|
1728
|
+
value: string;
|
1729
|
+
}
|
1730
|
+
|
1731
|
+
declare interface TagTranslationFieldType extends TagMetadataFieldDefinition {
|
1732
|
+
type: TagMetadataFieldType.TRANSLATION;
|
1733
|
+
value: Translation;
|
1734
|
+
}
|
1735
|
+
|
1736
|
+
/**
|
1737
|
+
* @public
|
1738
|
+
*/
|
1739
|
+
declare interface TivioAuth {
|
1740
|
+
/**
|
1741
|
+
* @param email
|
1742
|
+
* @param password
|
1743
|
+
*/
|
1744
|
+
createUserWithEmailAndPassword: CreateUserWithEmailAndPassword;
|
1745
|
+
/**
|
1746
|
+
* Sign in the user and starts listening on his purchases
|
1747
|
+
* @param email
|
1748
|
+
* @param password
|
1749
|
+
*/
|
1750
|
+
signInWithEmailAndPassword: (email: string, password: string) => Promise<string | null>;
|
1751
|
+
signInWithCustomToken: (token: string) => Promise<string | null>;
|
1752
|
+
signOut: () => Promise<void>;
|
1753
|
+
/**
|
1754
|
+
* Used for reset forgotten password by user
|
1755
|
+
*/
|
1756
|
+
resetPassword: (email: string) => Promise<void>;
|
1757
|
+
}
|
1758
|
+
|
1759
|
+
export declare type TivioBundle = TivioJsBundle;
|
1760
|
+
|
1761
|
+
export declare let tivioBundle: RemoteBundleState | null;
|
1762
|
+
|
1763
|
+
/**
|
1764
|
+
* @public
|
1765
|
+
*/
|
1766
|
+
declare interface TivioConfig {
|
1767
|
+
/**
|
1768
|
+
* Tells Tivio which technologies/protocols etc. is the device capable to play.
|
1769
|
+
* If not provided, Tivio will try to guess it (based on the browser).
|
1770
|
+
*/
|
1771
|
+
deviceCapabilities?: PlayerCapability_2[];
|
1772
|
+
/**
|
1773
|
+
* Additional options for deviceCapabilities
|
1774
|
+
*/
|
1775
|
+
capabilitiesOptions?: {
|
1776
|
+
/**
|
1777
|
+
* Should the player prefer HTTP sources instead HTTPs if they are available.
|
1778
|
+
* This can be used on platforms that support mixed content but do not support
|
1779
|
+
* specific HTTPS certificates. (e.g. certificates from Letsencrypt not supported on LG TVs)
|
1780
|
+
*/
|
1781
|
+
preferHttp?: boolean;
|
1782
|
+
};
|
1783
|
+
secret: string;
|
1784
|
+
language: LangCode;
|
1785
|
+
debug?: boolean;
|
1786
|
+
verbose?: boolean;
|
1787
|
+
firebaseApp?: any | null;
|
1788
|
+
firebaseFactory?: (config: Object, appName?: string) => firebase.FirebaseApp;
|
1789
|
+
authDomainOverride?: string;
|
1790
|
+
firestore?: any | null;
|
1791
|
+
currency: Currency;
|
1792
|
+
applicationId?: string;
|
1793
|
+
isTivioProApp?: boolean;
|
1794
|
+
lockApplicationHandle?: string;
|
1795
|
+
/**
|
1796
|
+
* Configuration for GDPR consent collection (CMP)
|
1797
|
+
*/
|
1798
|
+
cmp?: CmpConfig;
|
1799
|
+
/**
|
1800
|
+
* Device information - model, os, version, etc. This is useful for devices
|
1801
|
+
* where this information cannot be reliably auto-detected.
|
1802
|
+
*/
|
1803
|
+
deviceInfo?: DeviceInfo;
|
1804
|
+
player?: PlayerConfig;
|
1805
|
+
/**
|
1806
|
+
* Used for purposes where we need to differentiate organizations before it is known based on secret and data from DB.
|
1807
|
+
*
|
1808
|
+
* At this time it is necessary only for LG builds because on LG TVs it is needed to separate apps indexedDB storages
|
1809
|
+
* (otherwise organizations would share login token).
|
1810
|
+
*/
|
1811
|
+
customerId?: CustomerId;
|
1812
|
+
}
|
1813
|
+
|
1814
|
+
/**
|
1815
|
+
* @public
|
1816
|
+
*/
|
1817
|
+
declare type TivioGetters = {
|
1818
|
+
isTivioLoaded: (cb: (isLoaded: boolean) => void) => void;
|
1819
|
+
isSignedIn: () => boolean;
|
1820
|
+
/**
|
1821
|
+
* Get (or create) player wrapper instance
|
1822
|
+
* @param opt - player getter options
|
1823
|
+
* @returns {PlayerWrapper} player wrapper instance
|
1824
|
+
*/
|
1825
|
+
getPlayerWrapper: (opt: {
|
1826
|
+
playerWrapperId?: string;
|
1827
|
+
}) => PlayerWrapper_2;
|
1828
|
+
getOrganizationSubscriptions: () => Promise<Monetization[] | undefined>;
|
1829
|
+
/**
|
1830
|
+
* Get video by its id.
|
1831
|
+
* @param videoId - video id
|
1832
|
+
* @returns {Promise<Video | null>} video or null if video does not exists
|
1833
|
+
*/
|
1834
|
+
getVideoById: (videoId: string) => Promise<Video | null>;
|
1835
|
+
/**
|
1836
|
+
* Get player capabilities based on user's browser and OS as resolved by Tivio.
|
1837
|
+
* @returns PlayerCapability[]
|
1838
|
+
*/
|
1839
|
+
getPlayerCapabilities: () => PlayerCapability_2[];
|
1840
|
+
};
|
1841
|
+
|
1842
|
+
/**
|
1843
|
+
* @internal
|
1844
|
+
*/
|
1845
|
+
declare type TivioJsBundle = TivioJsBundleExposedApi & {
|
1846
|
+
init: (config: TivioConfig) => void | Promise<void>;
|
1847
|
+
tivio: any;
|
1848
|
+
};
|
1849
|
+
|
1850
|
+
/**
|
1851
|
+
* @public
|
1852
|
+
*/
|
1853
|
+
declare type TivioJsBundleExposedApi = {
|
1854
|
+
AdSource: any;
|
1855
|
+
ChannelSource: any;
|
1856
|
+
VodTivioSource: any;
|
1857
|
+
/**
|
1858
|
+
* Get (or create) player wrapper instance
|
1859
|
+
* @param id - player wrapper id
|
1860
|
+
* @returns {Player} player wrapper instance
|
1861
|
+
*/
|
1862
|
+
getPlayerWrapper: (id: string) => Player;
|
1863
|
+
/**
|
1864
|
+
* Get tv channel by its id.
|
1865
|
+
* @param tvChannelId - tv channel id
|
1866
|
+
* @returns {Promise<TvChannel | null>} channel or null if tv channel does not exists
|
1867
|
+
*/
|
1868
|
+
getTvChannelById: (tvChannelId: string) => Promise<TvChannel | null>;
|
1869
|
+
/**
|
1870
|
+
* Get tag by its id.
|
1871
|
+
* @param tagId - tag id
|
1872
|
+
* @returns {Promise<Tag | null>} widget or null if tag does not exists
|
1873
|
+
*/
|
1874
|
+
getTagById: (tagId: string) => Promise<Tag | null>;
|
1875
|
+
createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
|
1876
|
+
destroy: () => Promise<void>;
|
1877
|
+
} & Pick<TivioGetters, 'getVideoById'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
|
1878
|
+
|
1879
|
+
/**
|
1880
|
+
* @public
|
1881
|
+
*/
|
1882
|
+
declare interface TivioPlayerWrapper {
|
1883
|
+
addEventListener: (eventType: PlayerWrapperEventTypeType, listener: Listener) => void;
|
1884
|
+
reportError: (error: Error) => void;
|
1885
|
+
reportPlaybackEnded: () => void;
|
1886
|
+
reportTimeProgress: (ms: number) => void;
|
1887
|
+
seekTo: (ms: number) => void;
|
1888
|
+
/**
|
1889
|
+
* @param {Source} source - source to set
|
1890
|
+
* @param {string} calibrationId - id of calibration profile
|
1891
|
+
*/
|
1892
|
+
setSource: (source: Source | null, calibrationId?: string) => void;
|
1893
|
+
}
|
1894
|
+
|
1895
|
+
/**
|
1896
|
+
* @public
|
1897
|
+
*/
|
1898
|
+
declare type TivioSetters = {
|
1899
|
+
setBundleVersion: (bundleVersion: string | null) => void;
|
1900
|
+
/**
|
1901
|
+
* Set tivio language.
|
1902
|
+
* @param language
|
1903
|
+
*/
|
1904
|
+
setLanguage: (language: LangCode) => void;
|
1905
|
+
setStorageManager: (storageManager: StorageManager_2) => void;
|
1906
|
+
setUser: (userId: string | null, userPayload?: UserPayload) => Promise<void>;
|
1907
|
+
};
|
1908
|
+
|
1909
|
+
/**
|
1910
|
+
* @public
|
1911
|
+
*/
|
1912
|
+
declare type TivioSubscriptions = {
|
1913
|
+
subscribeToUser: (cb: (error: string | null, user: User | null) => void) => void;
|
1914
|
+
/**
|
1915
|
+
* Listen to video changes.
|
1916
|
+
* @param videoId - video id
|
1917
|
+
* @param cb - callback on video updates or on error
|
1918
|
+
*/
|
1919
|
+
subscribeToVideo: (videoId: string, cb: (error: Error | null, data: Video | null, disposer?: Disposer_2) => void) => void;
|
1920
|
+
subscribeToItemsInRow: SubscribeToItemsInRow;
|
1921
|
+
subscribeToRowsInScreen: SubscribeToRowsInScreen;
|
1922
|
+
subscribeToTaggedVideos: SubscribeToTaggedVideos;
|
1923
|
+
registerOverlayCallbacks: (callbacks: {
|
1924
|
+
onShow: () => void;
|
1925
|
+
onHide: () => void;
|
1926
|
+
}) => void;
|
1927
|
+
};
|
1928
|
+
|
1929
|
+
/**
|
1930
|
+
* @public
|
1931
|
+
*/
|
1932
|
+
declare type TivioVodSource = SourceBase & StartAndContinuePosition & {
|
1933
|
+
type: 'tivio_vod';
|
1934
|
+
/**
|
1935
|
+
* Allows Tivio to load monetization config an apply ads.
|
1936
|
+
*/
|
1937
|
+
videoPath: string;
|
1938
|
+
};
|
1939
|
+
|
1940
|
+
/**
|
1941
|
+
* @public
|
1942
|
+
* Video track
|
1943
|
+
*/
|
1944
|
+
declare interface Track {
|
1945
|
+
id: number;
|
1946
|
+
/**
|
1947
|
+
* e.g. 480, 720, 1080
|
1948
|
+
*/
|
1949
|
+
height: number;
|
1950
|
+
width: number;
|
1951
|
+
active: boolean;
|
1952
|
+
language: LangCode;
|
1953
|
+
}
|
1954
|
+
|
1955
|
+
/**
|
1956
|
+
* Represents one string in every supported language mutation.
|
1957
|
+
* @public
|
1958
|
+
*/
|
1959
|
+
declare type Translation = {
|
1960
|
+
[key in LangCode]?: string;
|
1961
|
+
};
|
1962
|
+
|
1963
|
+
/**
|
1964
|
+
* @public
|
1965
|
+
*/
|
1966
|
+
declare interface TvChannel extends RowItem {
|
1967
|
+
id: string;
|
1968
|
+
itemType: ROW_ITEM_TYPES.TV_CHANNEL;
|
1969
|
+
name: string;
|
1970
|
+
path: string;
|
1971
|
+
country?: string;
|
1972
|
+
filters: string[];
|
1973
|
+
logo?: string;
|
1974
|
+
logoPendingOverlayWidth?: string;
|
1975
|
+
hls: string;
|
1976
|
+
dash: string;
|
1977
|
+
/**
|
1978
|
+
* Returns all transactions and subscriptions applied to this tv channel.
|
1979
|
+
* Transactions before subscriptions, sorted by price ascending.
|
1980
|
+
*/
|
1981
|
+
getPurchasableMonetizations(options?: GetPurchasableMonetizationsOptions): PurchasableMonetization[];
|
1982
|
+
getSourceUrl(options?: {
|
1983
|
+
language?: LangCode;
|
1984
|
+
}): Promise<GetSourceUrlResponse & {
|
1985
|
+
language?: LangCode;
|
1986
|
+
}>;
|
1987
|
+
purchasableMonetization: any | null;
|
1988
|
+
price: number;
|
1989
|
+
cover: string;
|
1990
|
+
isPlayable: boolean;
|
1991
|
+
url: string;
|
1992
|
+
type?: TvChannelType;
|
1993
|
+
}
|
1994
|
+
|
1995
|
+
declare enum TvChannelType {
|
1996
|
+
/**
|
1997
|
+
* Classic live tv channel
|
1998
|
+
*/
|
1999
|
+
CLASSIC = "CLASSIC",
|
2000
|
+
/**
|
2001
|
+
* "Virtual" tv channel constructed from separate videos
|
2002
|
+
*/
|
2003
|
+
VIRTUAL = "VIRTUAL"
|
2004
|
+
}
|
2005
|
+
|
2006
|
+
/**
|
2007
|
+
* @public
|
2008
|
+
*/
|
2009
|
+
declare type TvMode = 'startover' | 'timeshift';
|
2010
|
+
|
2011
|
+
declare interface TvProgram {
|
2012
|
+
id: string;
|
2013
|
+
from: Date | null;
|
2014
|
+
to: Date | null;
|
2015
|
+
name: string;
|
2016
|
+
description: string;
|
2017
|
+
url: string;
|
2018
|
+
image: string;
|
2019
|
+
landscape?: string | null;
|
2020
|
+
video: Video | null;
|
2021
|
+
}
|
2022
|
+
|
2023
|
+
/**
|
2024
|
+
* @public
|
2025
|
+
*/
|
2026
|
+
declare type TvProgramSource = SourceBase & StartAndContinuePosition & {
|
2027
|
+
type: 'tv_program';
|
2028
|
+
/**
|
2029
|
+
* If epgTo is wrong, Tivio cannot correctly guess if the video it startover or timeshift . For such cases
|
2030
|
+
* Tivio needs explicit tv mode.
|
2031
|
+
* null if source begins in the future.
|
2032
|
+
*/
|
2033
|
+
tvMode: 'startover' | 'timeshift' | null;
|
2034
|
+
/**
|
2035
|
+
* Tivio needs channel name in order to load markers.
|
2036
|
+
*/
|
2037
|
+
channelName: string;
|
2038
|
+
/**
|
2039
|
+
* Tivio needs EPG from in order to load markers.
|
2040
|
+
*/
|
2041
|
+
epgFrom: Date;
|
2042
|
+
/**
|
2043
|
+
* Tivio needs EPG to in order to load markers.
|
2044
|
+
*/
|
2045
|
+
epgTo: Date;
|
2046
|
+
/**
|
2047
|
+
* When the stream (provided in uri) really starts - typically few minutes before epgFrom.
|
2048
|
+
*/
|
2049
|
+
streamStart: Date;
|
2050
|
+
};
|
2051
|
+
|
2052
|
+
/**
|
2053
|
+
* @public
|
2054
|
+
*/
|
2055
|
+
declare type User = {
|
2056
|
+
/**
|
2057
|
+
* Unique id of the corresponding user document.
|
2058
|
+
*/
|
2059
|
+
id: string;
|
2060
|
+
/**
|
2061
|
+
* Returns "active" (non-expired) purchases so they give access to some content.
|
2062
|
+
* Does not return voucher purchases because they give access to videos/subscriptions only for user who activates voucher
|
2063
|
+
* not for user who purchases it.
|
2064
|
+
*/
|
2065
|
+
purchases: Purchase[];
|
2066
|
+
/**
|
2067
|
+
* Returns all PAID or CANCELLED user purchases (expired and non-expired)
|
2068
|
+
*/
|
2069
|
+
allPurchases: Purchase[];
|
2070
|
+
availablePromotionsIds: string[];
|
2071
|
+
/**
|
2072
|
+
* Returns "active" (not CANCELLED) VoD purchases ("transaction" type)
|
2073
|
+
*/
|
2074
|
+
purchasedVods: Purchase[];
|
2075
|
+
/**
|
2076
|
+
* Returns "active" (non-expired) subscription purchases
|
2077
|
+
*/
|
2078
|
+
purchasedSubscriptions: Purchase[];
|
2079
|
+
/**
|
2080
|
+
* Returns last expired subscription which user can renew or undefined
|
2081
|
+
*/
|
2082
|
+
extendableSubscription?: Purchase;
|
2083
|
+
getPurchasedVideos: () => unknown[];
|
2084
|
+
getOneTimePurchases: () => Purchase[];
|
2085
|
+
isPurchasesInitialized: boolean;
|
2086
|
+
isSignedIn: boolean;
|
2087
|
+
isReady: boolean;
|
2088
|
+
email?: string;
|
2089
|
+
type?: UserType;
|
2090
|
+
photoURL: string | null;
|
2091
|
+
name?: string;
|
2092
|
+
/**
|
2093
|
+
* Authentication id differs from {@link id}.
|
2094
|
+
*/
|
2095
|
+
authUserId?: string;
|
2096
|
+
favorites: any[];
|
2097
|
+
watchedPositions: any[];
|
2098
|
+
watchHistory: any[];
|
2099
|
+
profiles: any[];
|
2100
|
+
activeUserProfileId: string | null;
|
2101
|
+
patreon?: PatreonUserAuth;
|
2102
|
+
subscriptionIdsToShow: string[] | null;
|
2103
|
+
followedOrganizationIds: string[];
|
2104
|
+
isAnonymous: boolean;
|
2105
|
+
isDiscordConnected: boolean;
|
2106
|
+
createUserProfile: (request: any) => Promise<void>;
|
2107
|
+
deleteUserProfile: (profileId: string) => Promise<void>;
|
2108
|
+
setActiveUserProfileId: (id: string) => void;
|
2109
|
+
getFollowedOrganizations: () => Promise<Array<FollowedOrganizationData | undefined>>;
|
2110
|
+
sendFinalizeRegistrationEmail: (email: string) => Promise<void>;
|
2111
|
+
isUserAlreadyRegisteredByTenant: (email: string, tenantId: string) => Promise<boolean>;
|
2112
|
+
getAllExtendableSubscriptions: () => Promise<Purchase[]>;
|
2113
|
+
};
|
2114
|
+
|
2115
|
+
/**
|
2116
|
+
* @public
|
2117
|
+
*/
|
2118
|
+
declare type UserPayload = Record<string, any>;
|
2119
|
+
|
2120
|
+
/**
|
2121
|
+
* @public
|
2122
|
+
*/
|
2123
|
+
declare enum UserType {
|
2124
|
+
ORGANIZATION_USER = "ORGANIZATION_USER",
|
2125
|
+
TIVIO_USER = "TIVIO_USER"
|
2126
|
+
}
|
2127
|
+
|
2128
|
+
/**
|
2129
|
+
* @public
|
2130
|
+
* null - classic VAST
|
2131
|
+
* VPAID - VAST with VPAID extension
|
2132
|
+
* others...
|
2133
|
+
*/
|
2134
|
+
declare type VastApiFramework = string | 'VPAID' | null;
|
2135
|
+
|
2136
|
+
/**
|
2137
|
+
* @public
|
2138
|
+
*/
|
2139
|
+
declare enum VastProvider {
|
2140
|
+
CNC_PREBID = "cnc-prebid",
|
2141
|
+
CNC_STARGAZE_PREROLL_1 = "cnc-stargaze-preroll-1",
|
2142
|
+
CNC_STARGAZE_PREROLL_2 = "cnc-stargaze-preroll-2",
|
2143
|
+
CNC_STARGAZE_MIDROLL = "cnc-stargaze-midroll",
|
2144
|
+
ETARGET_PREBID = "etarget-prebid",
|
2145
|
+
FALLBACK_HLS = "fallback-hls",
|
2146
|
+
FALLBACK_MP4 = "fallback",
|
2147
|
+
GARAZ_TV = "garaz.tv",
|
2148
|
+
GARAZ_TV_DEV = "garaz.tv.dev",
|
2149
|
+
IMPRESSION_MEDIA_PREBID = "impressionMedia-prebid",
|
2150
|
+
JOJ_ADFORM = "joj",
|
2151
|
+
JOJ_SMART = "joj-smart",
|
2152
|
+
JOJ_AD_MANAGER_VOD_PREROLL = "joj-ad-manager-vod-preroll",
|
2153
|
+
JOJ_AD_MANAGER_VOD_MIDROLL = "joj-ad-manager-vod-midroll",
|
2154
|
+
JOJ_AD_MANAGER_LIVE_PREROLL = "joj-ad-manager-live-preroll",
|
2155
|
+
MALL_TV = "malltv",
|
2156
|
+
MALL_TV_PREBID = "malltv-prebid",
|
2157
|
+
PRIMA = "prima",
|
2158
|
+
TEST = "test",
|
2159
|
+
TEST_VPAID = "test-vpaid",
|
2160
|
+
TIVIO_ADS = "tivio-ads",
|
2161
|
+
JOJ_TEST_AD_FORM_PROGRAMMATIC = "joj-test-ad-form-programmatic",
|
2162
|
+
JOJ_TEST_TESTER_VASTERIX = "joj-test-tester-vasterix",
|
2163
|
+
JOJ_TEST_TESTER_ADFORM_30 = "joj-test-tester-adform-30"
|
2164
|
+
}
|
2165
|
+
|
2166
|
+
/**
|
2167
|
+
* @public
|
2168
|
+
*/
|
2169
|
+
declare interface Video extends RowItem, MonetizableItem, ReactableContent {
|
2170
|
+
id: string;
|
2171
|
+
itemType: ROW_ITEM_TYPES.VIDEO;
|
2172
|
+
/**
|
2173
|
+
* @deprecated use assets instead
|
2174
|
+
*/
|
2175
|
+
cover: string | null;
|
2176
|
+
sectionId: string | null;
|
2177
|
+
channelId: string | null;
|
2178
|
+
duration: number;
|
2179
|
+
path: string;
|
2180
|
+
tags: Tag[];
|
2181
|
+
image: string | null;
|
2182
|
+
isPlayable: boolean;
|
2183
|
+
monetizations: Monetization[];
|
2184
|
+
getSourceUrl(options?: {
|
2185
|
+
language?: LangCode;
|
2186
|
+
}): Promise<GetSourceUrlResponse & {
|
2187
|
+
language?: LangCode;
|
2188
|
+
}>;
|
2189
|
+
getSeekingMatrixPreviewByTime(timeMs: number, offsetIndex?: number): {
|
2190
|
+
url: string;
|
2191
|
+
x: number;
|
2192
|
+
y: number;
|
2193
|
+
width: number;
|
2194
|
+
height: number;
|
2195
|
+
interval: number;
|
2196
|
+
timeMs: number;
|
2197
|
+
} | null;
|
2198
|
+
purchasableMonetization: any | null;
|
2199
|
+
transaction: PurchasableMonetization | undefined;
|
2200
|
+
subscriptions: PurchasableMonetization[];
|
2201
|
+
sources?: any[];
|
2202
|
+
allSources?: any[];
|
2203
|
+
isPlaylist: boolean;
|
2204
|
+
name: string;
|
2205
|
+
urlNames?: string[];
|
2206
|
+
urlName?: string;
|
2207
|
+
price: number | null;
|
2208
|
+
detailedPrice: DetailedPrice | null;
|
2209
|
+
url: string;
|
2210
|
+
adMonetizationId?: string;
|
2211
|
+
from?: Date;
|
2212
|
+
to?: Date;
|
2213
|
+
detailBanner?: string;
|
2214
|
+
descriptionRich?: string;
|
2215
|
+
organizationId?: string;
|
2216
|
+
linkedVideosRaw: LinkedVideoRaw[] | undefined;
|
2217
|
+
linkedVideos: LinkedVideo[] | undefined;
|
2218
|
+
pipPaths?: string[];
|
2219
|
+
contentType: VideoContentType | null;
|
2220
|
+
year?: number;
|
2221
|
+
episodeNumber?: number;
|
2222
|
+
seasonNumber?: number;
|
2223
|
+
getTagsOfType: (type: string) => Tag[];
|
2224
|
+
geoBlocking: GeoBlocking | undefined;
|
2225
|
+
loadLinkedVideos: () => any;
|
2226
|
+
getLinkedVideos: (type: any) => any;
|
2227
|
+
trailer: Video | null;
|
2228
|
+
teaser: Video | null;
|
2229
|
+
hasTasting: boolean;
|
2230
|
+
isTastingValid: () => boolean;
|
2231
|
+
tasting: Video | null;
|
2232
|
+
watchPosition: number | null;
|
2233
|
+
isFavorite: boolean;
|
2234
|
+
addToFavorites: () => void;
|
2235
|
+
removeFromFavorites: () => void;
|
2236
|
+
availability: ContentAvailability | null;
|
2237
|
+
sourceLanguages: LangCode[];
|
2238
|
+
urlByLanguage: (lang: LangCode) => string | undefined;
|
2239
|
+
getApplicationName: () => string | undefined;
|
2240
|
+
getApplicationLogo: () => string | undefined;
|
2241
|
+
setApplicationData: (applicationData: RowItemApplicationData) => void;
|
2242
|
+
linkedVideosInNotLoaded: () => boolean | undefined;
|
2243
|
+
initApplication: () => Promise<void>;
|
2244
|
+
init: () => Promise<void>;
|
2245
|
+
progress?: number;
|
2246
|
+
}
|
2247
|
+
|
2248
|
+
/**
|
2249
|
+
* @public
|
2250
|
+
*/
|
2251
|
+
declare enum VideoContentType {
|
2252
|
+
/**
|
2253
|
+
* Default video content type
|
2254
|
+
*/
|
2255
|
+
VIDEO = "VIDEO",
|
2256
|
+
FILM = "FILM",
|
2257
|
+
SERIES = "SERIES"
|
2258
|
+
}
|
2259
|
+
|
2260
|
+
declare enum VideoSourceCodec {
|
2261
|
+
H264 = "h264",
|
2262
|
+
H265 = "h265"
|
2263
|
+
}
|
2264
|
+
|
2265
|
+
declare enum VideoSourceEncryption {
|
2266
|
+
NONE = "none",
|
2267
|
+
WIDEVINE = "widevine",
|
2268
|
+
FAIRPLAY = "fairplay",
|
2269
|
+
PLAYREADY = "playready"
|
2270
|
+
}
|
2271
|
+
|
2272
|
+
declare enum VideoSourceProtocol {
|
2273
|
+
HLS = "hls",
|
2274
|
+
DASH = "dash",
|
2275
|
+
MP4 = "mp4"
|
2276
|
+
}
|
2277
|
+
|
2278
|
+
/**
|
2279
|
+
* @public
|
2280
|
+
*/
|
2281
|
+
declare interface VirtualChannelSourceInterface extends ChannelSourceInterface {
|
2282
|
+
tvChannelType: TvChannelType.VIRTUAL;
|
2283
|
+
program?: TvProgram | null;
|
2284
|
+
video?: Video | null;
|
2285
|
+
clone(params?: Partial<VirtualChannelSourceParams>): VirtualChannelSourceInterface;
|
2286
|
+
initializeNext(): Promise<void>;
|
2287
|
+
deltaMsFromStart: number;
|
2288
|
+
}
|
2289
|
+
|
2290
|
+
/**
|
2291
|
+
* @public
|
2292
|
+
*/
|
2293
|
+
declare interface VirtualChannelSourceParams extends ChannelSourceParams {
|
2294
|
+
tvChannelType: TvChannelType.VIRTUAL;
|
2295
|
+
currentProgram?: TvProgram | null;
|
2296
|
+
drm?: Drm;
|
2297
|
+
}
|
2298
|
+
|
2299
|
+
/**
|
2300
|
+
* @public
|
2301
|
+
*/
|
2302
|
+
declare interface VodExternalSourceInterface extends PlayerSourceInterface<SourceType.VOD_EXTERNAL> {
|
2303
|
+
monetizationId?: string;
|
2304
|
+
originalOptions: Record<string, any>;
|
2305
|
+
poster: string | null;
|
2306
|
+
}
|
2307
|
+
|
2308
|
+
/**
|
2309
|
+
* @public
|
2310
|
+
*/
|
2311
|
+
declare interface VodTivioSourceInterface extends PlayerSourceInterface<SourceType.VOD_TIVIO> {
|
2312
|
+
/**
|
2313
|
+
* e.g. 259ud0fgdf4
|
2314
|
+
*/
|
2315
|
+
adMonetizationId?: string;
|
2316
|
+
/**
|
2317
|
+
* e.g. videos/1532543
|
2318
|
+
*/
|
2319
|
+
videoPath: string;
|
2320
|
+
poster: string | null;
|
2321
|
+
/**
|
2322
|
+
* Position to continue playing from in milliseconds
|
2323
|
+
*/
|
2324
|
+
continuePositionMs?: ContinuePosition;
|
2325
|
+
/**
|
2326
|
+
* Drm configuration
|
2327
|
+
*/
|
2328
|
+
drm?: Drm;
|
2329
|
+
watermark: Watermark | null;
|
2330
|
+
canWatchOnDevice: boolean;
|
2331
|
+
isAvailable: boolean;
|
2332
|
+
availability: ContentAvailability | null;
|
2333
|
+
video: Video;
|
2334
|
+
clone: (params?: Partial<VodTivioSourceParams>) => VodTivioSourceInterface;
|
2335
|
+
}
|
2336
|
+
|
2337
|
+
/**
|
2338
|
+
* @public
|
2339
|
+
*/
|
2340
|
+
declare interface VodTivioSourceParams extends PlayerSourceParams<SourceType.VOD_TIVIO> {
|
2341
|
+
videoPath: string;
|
2342
|
+
adMonetizationId?: string;
|
2343
|
+
language?: LangCode;
|
2344
|
+
drm?: Drm;
|
2345
|
+
ignoreWatchPosition?: boolean;
|
2346
|
+
}
|
2347
|
+
|
2348
|
+
/**
|
2349
|
+
* @public
|
2350
|
+
*/
|
2351
|
+
declare interface Watermark {
|
2352
|
+
caption: string;
|
2353
|
+
size: 'large' | 'medium';
|
2354
|
+
}
|
2355
|
+
|
2356
|
+
/**
|
2357
|
+
* @public
|
2358
|
+
*/
|
2359
|
+
declare interface WhereFilter {
|
2360
|
+
field: string;
|
2361
|
+
operator: WhereFilterOp;
|
2362
|
+
value: any;
|
2363
|
+
}
|
2364
|
+
|
2365
|
+
declare type WhereFilterOp = '<' | '<=' | '==' | '!=' | '>=' | '>' | 'array-contains' | 'in' | 'array-contains-any' | 'not-in';
|
2366
|
+
|
2367
|
+
export { }
|