@castlabs/prestoplay 6.18.0 → 6.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +115 -114
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +578 -576
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +77 -75
- package/cjs/cl.externs.js +174 -292
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +70 -71
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -29
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mse.js +312 -311
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -15
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +29 -28
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +18 -18
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +90 -89
- package/cl.conviva.js +27 -27
- package/cl.core.js +475 -474
- package/cl.crypto.js +9 -9
- package/cl.dash.js +71 -70
- package/cl.externs.js +171 -293
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +74 -72
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +276 -274
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/clpp.styles.css +14 -0
- package/package.json +1 -1
- package/typings.d.ts +379 -384
package/typings.d.ts
CHANGED
|
@@ -183,6 +183,9 @@ export namespace clpp {
|
|
|
183
183
|
create(config: clpp.PlayerConfiguration): clpp.PlayerPlugin|null;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
+
/**
|
|
187
|
+
* Adaptive Bitrate Streaming (ABR) configuration.
|
|
188
|
+
*/
|
|
186
189
|
export type AbrConfiguration = {
|
|
187
190
|
/**
|
|
188
191
|
* The largest fraction of the estimated bandwidth we should use. We should
|
|
@@ -209,7 +212,7 @@ export namespace clpp {
|
|
|
209
212
|
enabled: boolean;
|
|
210
213
|
/**
|
|
211
214
|
* Restrictions used only for initial ABR selection. This can be used i.e.
|
|
212
|
-
* in DRM multikey scenarios, to ensure that first selected track will be
|
|
215
|
+
* in DRM multikey scenarios, to ensure that the first selected track will be
|
|
213
216
|
* playable on any platform. Restrictions are applied on every playback
|
|
214
217
|
* attempt if defined.
|
|
215
218
|
*/
|
|
@@ -219,23 +222,26 @@ export namespace clpp {
|
|
|
219
222
|
* Any track that fails to meet these restrictions will not be selected
|
|
220
223
|
* automatically, but will still appear in the track list and can be selected
|
|
221
224
|
* via {@link clpp.TrackManager#setVideoTrack}. If no tracks meet these
|
|
222
|
-
* restrictions,
|
|
223
|
-
* or low-bandwidth variant instead.
|
|
225
|
+
* restrictions, the ABR Manager should not fail but should choose
|
|
226
|
+
* a low-resolution or low-bandwidth variant instead.
|
|
224
227
|
*/
|
|
225
|
-
restrictions
|
|
228
|
+
restrictions?: clpp.Restrictions;
|
|
226
229
|
/**
|
|
227
230
|
* The minimum amount of time that must pass between switches, in
|
|
228
231
|
* seconds. This keeps us from changing too often and annoying the user.
|
|
229
232
|
*/
|
|
230
233
|
switchInterval: number;
|
|
231
234
|
/**
|
|
232
|
-
* Defaults to
|
|
235
|
+
* Defaults to true.
|
|
233
236
|
*
|
|
234
|
-
* Enables reading CMSD (Common Media Server Data) of
|
|
237
|
+
* Enables reading CMSD (Common Media Server Data) of requests
|
|
235
238
|
* and use it for ABR decisions.
|
|
236
|
-
* estimatedThroughputKbps(etp)
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
+
* estimatedThroughputKbps (etp)
|
|
240
|
+
* When property is present as part of CMSD-Dynamic header
|
|
241
|
+
* its value is used as a bandwidth estimate.
|
|
242
|
+
* maxSuggestedBitrateKbps (mb)
|
|
243
|
+
* When property is present as part of CMSD-Dynamic header
|
|
244
|
+
* its value is used as a maximum bandwidth limit.
|
|
239
245
|
*/
|
|
240
246
|
useCmsd: boolean;
|
|
241
247
|
/**
|
|
@@ -246,6 +252,16 @@ export namespace clpp {
|
|
|
246
252
|
useSwitchIntervalForInitialSwitch: boolean;
|
|
247
253
|
}
|
|
248
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Configuration for ads.
|
|
257
|
+
*/
|
|
258
|
+
export type AdsConfiguration = {
|
|
259
|
+
/**
|
|
260
|
+
* Configuration for ads based on HLS interstitials.
|
|
261
|
+
*/
|
|
262
|
+
hls?: clpp.HlsAdsConfiguration;
|
|
263
|
+
}
|
|
264
|
+
|
|
249
265
|
/**
|
|
250
266
|
* Broadpeak plugin configuration.
|
|
251
267
|
*/
|
|
@@ -696,6 +712,21 @@ export namespace clpp {
|
|
|
696
712
|
type: clpp.ads.PodType;
|
|
697
713
|
}
|
|
698
714
|
|
|
715
|
+
/**
|
|
716
|
+
* Configuration for ads based on HLS interstitials.
|
|
717
|
+
*/
|
|
718
|
+
export type HlsAdsConfiguration = {
|
|
719
|
+
/**
|
|
720
|
+
* If true enable support.
|
|
721
|
+
*/
|
|
722
|
+
enable?: boolean;
|
|
723
|
+
/**
|
|
724
|
+
* How many seconds ahead of an interstitial date range should its
|
|
725
|
+
* interstitial assets or asset lists be requested and preloaded.
|
|
726
|
+
*/
|
|
727
|
+
resolutionOffsetSec?: number;
|
|
728
|
+
}
|
|
729
|
+
|
|
699
730
|
/**
|
|
700
731
|
* HLS-SMPTE plugin configuration.
|
|
701
732
|
*/
|
|
@@ -907,15 +938,14 @@ export namespace clpp {
|
|
|
907
938
|
*/
|
|
908
939
|
export type MediaSourceConfiguration = {
|
|
909
940
|
/**
|
|
910
|
-
* The switching
|
|
911
|
-
*
|
|
912
|
-
*
|
|
913
|
-
*
|
|
914
|
-
*
|
|
915
|
-
*
|
|
916
|
-
* switching, whether through ABR or user selection.
|
|
941
|
+
* The switching strategy determines how to handle codec changes during
|
|
942
|
+
* playback. The `SMOOTH` strategy uses `SourceBuffer.changeType()` - if
|
|
943
|
+
* it’s available and reliably supported on a device - to dynamically switch
|
|
944
|
+
* between streams encoded with different codecs. The `PREVENT` strategy,
|
|
945
|
+
* which is the default, actively tries to prevent scenarios where different
|
|
946
|
+
* codecs are available for switching, whether through ABR or user selection.
|
|
917
947
|
*/
|
|
918
|
-
codecSwitchingStrategy
|
|
948
|
+
codecSwitchingStrategy?: clpp.CodecSwitchingStrategy;
|
|
919
949
|
}
|
|
920
950
|
|
|
921
951
|
/**
|
|
@@ -1133,6 +1163,10 @@ export namespace clpp {
|
|
|
1133
1163
|
* ABR configuration and settings.
|
|
1134
1164
|
*/
|
|
1135
1165
|
abr?: Partial<clpp.AbrConfiguration>;
|
|
1166
|
+
/**
|
|
1167
|
+
* Ads configuration.
|
|
1168
|
+
*/
|
|
1169
|
+
ads?: Partial<clpp.AdsConfiguration>;
|
|
1136
1170
|
/**
|
|
1137
1171
|
* Configures the autoplay behavior.
|
|
1138
1172
|
*/
|
|
@@ -1195,7 +1229,7 @@ export namespace clpp {
|
|
|
1195
1229
|
*/
|
|
1196
1230
|
id?: string;
|
|
1197
1231
|
/**
|
|
1198
|
-
*
|
|
1232
|
+
* Google IMA ads plugin configuration.
|
|
1199
1233
|
*/
|
|
1200
1234
|
ima?: Partial<clpp.ImaConfiguration>;
|
|
1201
1235
|
/**
|
|
@@ -1220,7 +1254,7 @@ export namespace clpp {
|
|
|
1220
1254
|
*/
|
|
1221
1255
|
manifest?: Partial<clpp.ManifestConfiguration>;
|
|
1222
1256
|
/**
|
|
1223
|
-
* Media source configuration
|
|
1257
|
+
* Media source configuration.
|
|
1224
1258
|
*/
|
|
1225
1259
|
mediaSource?: Partial<clpp.MediaSourceConfiguration>;
|
|
1226
1260
|
/**
|
|
@@ -1246,13 +1280,8 @@ export namespace clpp {
|
|
|
1246
1280
|
*/
|
|
1247
1281
|
playlist?: Partial<clpp.PlaylistConfiguration>;
|
|
1248
1282
|
/**
|
|
1249
|
-
*
|
|
1250
|
-
*
|
|
1251
|
-
* If `true`, a forced text track is preferred. If the content has no text
|
|
1252
|
-
* tracks marked as forced and the value is `true`, no text track is chosen.
|
|
1253
|
-
* If `true` and the `preferredTextLanguage` is set, and the specified
|
|
1254
|
-
* language is available for the forced text track, the forced text track will
|
|
1255
|
-
* be preferred over the non-forced subtitles and be enabled at startup.
|
|
1283
|
+
* If `true`, the forced text track is preferred during automatic
|
|
1284
|
+
* track selection.
|
|
1256
1285
|
*/
|
|
1257
1286
|
preferForcedSubtitles?: boolean;
|
|
1258
1287
|
/**
|
|
@@ -1335,7 +1364,7 @@ export namespace clpp {
|
|
|
1335
1364
|
*/
|
|
1336
1365
|
sessions?: Partial<clpp.SessionsConfiguration>;
|
|
1337
1366
|
/**
|
|
1338
|
-
* SIMID plugin configuration
|
|
1367
|
+
* SIMID plugin configuration.
|
|
1339
1368
|
*/
|
|
1340
1369
|
simid?: Partial<clpp.SimidConfiguration>;
|
|
1341
1370
|
/**
|
|
@@ -1349,7 +1378,7 @@ export namespace clpp {
|
|
|
1349
1378
|
*/
|
|
1350
1379
|
startTime?: number|null;
|
|
1351
1380
|
/**
|
|
1352
|
-
* The streaming configuration
|
|
1381
|
+
* The streaming configuration.
|
|
1353
1382
|
*/
|
|
1354
1383
|
streaming?: Partial<clpp.StreamingConfiguration>;
|
|
1355
1384
|
/**
|
|
@@ -1652,7 +1681,7 @@ export namespace clpp {
|
|
|
1652
1681
|
*/
|
|
1653
1682
|
export type Restrictions = {
|
|
1654
1683
|
/**
|
|
1655
|
-
* The
|
|
1684
|
+
* The maximum bandwidth of a track in bit/sec.
|
|
1656
1685
|
*/
|
|
1657
1686
|
maxBandwidth: number;
|
|
1658
1687
|
/**
|
|
@@ -3205,6 +3234,14 @@ export namespace clpp {
|
|
|
3205
3234
|
* Triggered when an ad pod ended.
|
|
3206
3235
|
*/
|
|
3207
3236
|
AD_BREAK_STOPPED = "ad-break-stopped",
|
|
3237
|
+
/**
|
|
3238
|
+
* Triggered when the X-ASSET-LIST request is sent.
|
|
3239
|
+
*/
|
|
3240
|
+
AD_HLS_ASSET_LIST_REQUEST = "ad-hls-asset-list-request",
|
|
3241
|
+
/**
|
|
3242
|
+
* Triggered when the X-ASSET-LIST response is received.
|
|
3243
|
+
*/
|
|
3244
|
+
AD_HLS_ASSET_LIST_RESPONSE = "ad-hls-asset-list-response",
|
|
3208
3245
|
/**
|
|
3209
3246
|
* Triggered when a SIMID Ad started.
|
|
3210
3247
|
*/
|
|
@@ -3238,7 +3275,7 @@ export namespace clpp {
|
|
|
3238
3275
|
*/
|
|
3239
3276
|
AIRPLAY_CASTING_ENDED = "airplay-casting-ended",
|
|
3240
3277
|
/**
|
|
3241
|
-
* Triggered a new cue
|
|
3278
|
+
* Triggered when a new cue has been added to the timeline.
|
|
3242
3279
|
*/
|
|
3243
3280
|
TIMELINE_CUE_ADDED = "timeline-cue-added",
|
|
3244
3281
|
/**
|
|
@@ -3249,6 +3286,10 @@ export namespace clpp {
|
|
|
3249
3286
|
* Triggered when a timeline cue is exited.
|
|
3250
3287
|
*/
|
|
3251
3288
|
TIMELINE_CUE_EXIT = "timeline-cue-exit",
|
|
3289
|
+
/**
|
|
3290
|
+
* Triggered when timeline cues have changed.
|
|
3291
|
+
*/
|
|
3292
|
+
TIMELINE_CUES_CHANGED = "timeline-cues-changed",
|
|
3252
3293
|
/**
|
|
3253
3294
|
* Triggered when a MPD type has changed from dynamic to static.
|
|
3254
3295
|
* Note: You can also listen to the {@link clpp.events.LIVE_TURNED_STATIC}
|
|
@@ -3305,6 +3346,10 @@ export namespace clpp {
|
|
|
3305
3346
|
* Online status changed.
|
|
3306
3347
|
*/
|
|
3307
3348
|
ONLINE_STATUS_CHANGED = "online-status-changed",
|
|
3349
|
+
/**
|
|
3350
|
+
* Triggered when CMSD headers were detected as part of a network response.
|
|
3351
|
+
*/
|
|
3352
|
+
CMSD_EVENT = "cmsd-event",
|
|
3308
3353
|
}
|
|
3309
3354
|
|
|
3310
3355
|
/**
|
|
@@ -3499,9 +3544,9 @@ export namespace clpp {
|
|
|
3499
3544
|
destroy(): Promise<void>;
|
|
3500
3545
|
/**
|
|
3501
3546
|
* Returns the ads manager or null if not available.
|
|
3502
|
-
* The ads manager is available when {@clpp.Player.load} is resolved.
|
|
3547
|
+
* The ads manager is available when {@link clpp.Player.load} is resolved.
|
|
3503
3548
|
*/
|
|
3504
|
-
getAdsManager(): clpp.ads.IAdsManager;
|
|
3549
|
+
getAdsManager(): clpp.ads.IAdsManager|null;
|
|
3505
3550
|
/**
|
|
3506
3551
|
* Returns an instance of {@link clpp.BufferInfo} which is an extended version
|
|
3507
3552
|
* of the native {@link TimeRanges} from the browser and adds some utility
|
|
@@ -4579,6 +4624,10 @@ export namespace clpp {
|
|
|
4579
4624
|
* An error raised when the play is not allowed.
|
|
4580
4625
|
*/
|
|
4581
4626
|
PLAY_NOT_ALLOWED = 3200,
|
|
4627
|
+
/**
|
|
4628
|
+
* An error raised when the player fails to be paused.
|
|
4629
|
+
*/
|
|
4630
|
+
PAUSE_FAILED = 3201,
|
|
4582
4631
|
/**
|
|
4583
4632
|
* The Player was unable to guess the manifest type based on file extension
|
|
4584
4633
|
* or MIME type. To fix, try one of the following:
|
|
@@ -4844,6 +4893,10 @@ export namespace clpp {
|
|
|
4844
4893
|
* transition, it will pause, waiting for the audio stream.
|
|
4845
4894
|
*/
|
|
4846
4895
|
INVALID_STREAMS_CHOSEN = 5005,
|
|
4896
|
+
/**
|
|
4897
|
+
* An error occurred while streaming the content.
|
|
4898
|
+
*/
|
|
4899
|
+
STREAMING_ERROR = 5006,
|
|
4847
4900
|
/**
|
|
4848
4901
|
* The manifest indicated protected content, but the manifest parser was
|
|
4849
4902
|
* unable to determine what key systems should be used.
|
|
@@ -5386,6 +5439,10 @@ export namespace clpp {
|
|
|
5386
5439
|
* The type of the ad pod.
|
|
5387
5440
|
*/
|
|
5388
5441
|
getPodType(): clpp.ads.PodType;
|
|
5442
|
+
/**
|
|
5443
|
+
* The playback position of the ad.
|
|
5444
|
+
*/
|
|
5445
|
+
getPosition(): number;
|
|
5389
5446
|
/**
|
|
5390
5447
|
* The position of the ad within the ad pod.
|
|
5391
5448
|
*/
|
|
@@ -5434,63 +5491,33 @@ export namespace clpp {
|
|
|
5434
5491
|
|
|
5435
5492
|
export interface IAdsManager {
|
|
5436
5493
|
/**
|
|
5437
|
-
* Gets the current time of the
|
|
5438
|
-
* If the ad is not loaded yet or has finished playing, the API would return
|
|
5439
|
-
* -1.
|
|
5494
|
+
* Gets the current time of the currently playing ad.
|
|
5440
5495
|
*/
|
|
5441
5496
|
getPosition(): number;
|
|
5442
5497
|
/**
|
|
5443
|
-
* Gets the volume
|
|
5498
|
+
* Gets the audio volume of the current ad.
|
|
5444
5499
|
*/
|
|
5445
5500
|
getVolume(): number;
|
|
5446
5501
|
/**
|
|
5447
|
-
* Pauses the
|
|
5448
|
-
* This function will be no-op when the ad is not loaded yet or is done
|
|
5449
|
-
* playing.
|
|
5502
|
+
* Pauses the currently playing ad.
|
|
5450
5503
|
*/
|
|
5451
5504
|
pause(): void;
|
|
5452
5505
|
/**
|
|
5453
|
-
* Resumes the
|
|
5454
|
-
* This function will be no-op when the ad is not loaded yet or is done
|
|
5455
|
-
* playing.
|
|
5506
|
+
* Resumes playback of the ad if it is paused.
|
|
5456
5507
|
*/
|
|
5457
5508
|
resume(): void;
|
|
5458
5509
|
/**
|
|
5459
|
-
* Sets the volume for the current ad.
|
|
5510
|
+
* Sets the audio volume for the current ad.
|
|
5460
5511
|
*
|
|
5461
|
-
* @param volume The volume to set, from 0
|
|
5512
|
+
* @param volume The volume to set, from 0 to 1.
|
|
5462
5513
|
*/
|
|
5463
5514
|
setVolume(volume: number): void;
|
|
5464
5515
|
/**
|
|
5465
|
-
* Skips the current ad
|
|
5466
|
-
* When called under other circumstances, skip has no effect.
|
|
5467
|
-
* After the skip is completed the AdsManager fires
|
|
5468
|
-
* an {@link clpp.events.AD_SKIPPED} event.
|
|
5516
|
+
* Skips the current ad if allowed by {@link clpp.ads.IAd.getSkipTimeOffset}.
|
|
5469
5517
|
*/
|
|
5470
5518
|
skip(): void;
|
|
5471
5519
|
}
|
|
5472
5520
|
|
|
5473
|
-
export interface IAdsManagerFactory {
|
|
5474
|
-
/**
|
|
5475
|
-
* Creates an ads manager.
|
|
5476
|
-
*
|
|
5477
|
-
* @param player The proxy player.
|
|
5478
|
-
*/
|
|
5479
|
-
create(player: clpp.Player): clpp.ads.IAdsManager;
|
|
5480
|
-
/**
|
|
5481
|
-
* Checks if this factory creates an ads manager that can play specified
|
|
5482
|
-
* ads.
|
|
5483
|
-
*
|
|
5484
|
-
* @param player Player instance
|
|
5485
|
-
* @param config The player configuration.
|
|
5486
|
-
*/
|
|
5487
|
-
isSupported(player: clpp.Player, config: clpp.PlayerConfiguration): boolean;
|
|
5488
|
-
/**
|
|
5489
|
-
* The factory name.
|
|
5490
|
-
*/
|
|
5491
|
-
name(): string;
|
|
5492
|
-
}
|
|
5493
|
-
|
|
5494
5521
|
export interface IAdsTimeline {
|
|
5495
5522
|
/**
|
|
5496
5523
|
* An array of offsets in seconds indicating
|
|
@@ -5559,6 +5586,10 @@ export namespace clpp {
|
|
|
5559
5586
|
* 1 - Server side
|
|
5560
5587
|
*/
|
|
5561
5588
|
SERVER_SIDE = 1,
|
|
5589
|
+
/**
|
|
5590
|
+
* 2 - Server guided
|
|
5591
|
+
*/
|
|
5592
|
+
SERVER_GUIDED = 2,
|
|
5562
5593
|
}
|
|
5563
5594
|
}
|
|
5564
5595
|
|
|
@@ -5770,6 +5801,12 @@ export namespace clpp {
|
|
|
5770
5801
|
* broadcasted to all connected senders.
|
|
5771
5802
|
*/
|
|
5772
5803
|
sendMessage(message: any, senderId?: string): void;
|
|
5804
|
+
/**
|
|
5805
|
+
* Set a Cast metadata object to be displayed on the Cast receiver and
|
|
5806
|
+
* broadcast it to all senders. This will overwrite any existing metadata or
|
|
5807
|
+
* remove it if `null` is passed.
|
|
5808
|
+
*/
|
|
5809
|
+
setContentMetadata(metadata: clpp.cast.utils.ReceiverMetadataObject|null): void;
|
|
5773
5810
|
/**
|
|
5774
5811
|
* Gives a possibility to intercept a `LoadRequestData` instance before
|
|
5775
5812
|
* passing it to Chromecast. Interceptor function takes load request data as
|
|
@@ -5845,6 +5882,15 @@ export namespace clpp {
|
|
|
5845
5882
|
* Shutdown receiver application and removes bound player instance.
|
|
5846
5883
|
*/
|
|
5847
5884
|
stop(): void;
|
|
5885
|
+
/**
|
|
5886
|
+
* Updates the Cast metadata object with new values. Any existing metadata
|
|
5887
|
+
* properties will be updated or replaced with the values provided in the
|
|
5888
|
+
* `metadata` object. If the `metadata` object is `null` or not provided, the
|
|
5889
|
+
* current metadata will remain unchanged. If no metadata is currently set,
|
|
5890
|
+
* and a valid `metadata` object is provided, it will initialize the metadata
|
|
5891
|
+
* with the given values.
|
|
5892
|
+
*/
|
|
5893
|
+
updateContentMetadata(metadata: clpp.cast.utils.ReceiverMetadataObject|null): void;
|
|
5848
5894
|
}
|
|
5849
5895
|
|
|
5850
5896
|
namespace utils {
|
|
@@ -6324,6 +6370,133 @@ export namespace clpp {
|
|
|
6324
6370
|
reason: number;
|
|
6325
6371
|
}
|
|
6326
6372
|
|
|
6373
|
+
/**
|
|
6374
|
+
* CMSD Dynamic values.
|
|
6375
|
+
* Keys whose values apply only to the next transmission hop.
|
|
6376
|
+
* Typically a new CMSD-Dynamic header instance will be added
|
|
6377
|
+
* by each intermediary participating in the delivery.
|
|
6378
|
+
*/
|
|
6379
|
+
export type CmsdDynamic = {
|
|
6380
|
+
/**
|
|
6381
|
+
* Key is included without a value if the server is under duress,
|
|
6382
|
+
* due to cpu, memory, disk IO, network IO or other reasons.
|
|
6383
|
+
* Header-Key: du
|
|
6384
|
+
*/
|
|
6385
|
+
duress?: boolean;
|
|
6386
|
+
/**
|
|
6387
|
+
* The throughput between the server and the client over the currently
|
|
6388
|
+
* negotiated transport as estimated by the server at the start
|
|
6389
|
+
* of the response. The value is expressed in units of kilobits per second.
|
|
6390
|
+
* Header-Key: etp
|
|
6391
|
+
*/
|
|
6392
|
+
estimatedThroughputKbps?: number;
|
|
6393
|
+
/**
|
|
6394
|
+
* The maximum bitrate value that the player
|
|
6395
|
+
* SHOULD play in its Adaptive Bit Rate (ABR) ladder.
|
|
6396
|
+
* Header-Key: mb
|
|
6397
|
+
*/
|
|
6398
|
+
maxSuggestedBitrateKbps?: number;
|
|
6399
|
+
/**
|
|
6400
|
+
* The time elapsed between the receipt of the request
|
|
6401
|
+
* and when the first byte of the body becomes available to send to the client.
|
|
6402
|
+
* Header-Key: rd
|
|
6403
|
+
*/
|
|
6404
|
+
responseDelay?: number;
|
|
6405
|
+
/**
|
|
6406
|
+
* Estimated round trip time between client and server.
|
|
6407
|
+
* This estimate may be derived from the transport handshake.
|
|
6408
|
+
* Header-Key: rtt
|
|
6409
|
+
*/
|
|
6410
|
+
roundTripTime?: number;
|
|
6411
|
+
}
|
|
6412
|
+
|
|
6413
|
+
/**
|
|
6414
|
+
* CMSD Static values.
|
|
6415
|
+
* Keys whose values persist over multiple requests for the object.
|
|
6416
|
+
*/
|
|
6417
|
+
export type CmsdStatic = {
|
|
6418
|
+
/**
|
|
6419
|
+
* The wallclock time at which the first byte of this object
|
|
6420
|
+
* became available at the origin for successful request.
|
|
6421
|
+
* The time is expressed as integer milliseconds since the Unix Epoch.
|
|
6422
|
+
* Header-Key: at
|
|
6423
|
+
*/
|
|
6424
|
+
availabilityTime?: number;
|
|
6425
|
+
/**
|
|
6426
|
+
* The encoded bitrate of the audio or video object being requested.
|
|
6427
|
+
* Header-Key: br
|
|
6428
|
+
*/
|
|
6429
|
+
encodedBitrateKbps?: number;
|
|
6430
|
+
/**
|
|
6431
|
+
* The number of milliseconds that this response was held back by
|
|
6432
|
+
* an origin before returning.
|
|
6433
|
+
* Header-Key: ht
|
|
6434
|
+
*/
|
|
6435
|
+
heldTime?: number;
|
|
6436
|
+
/**
|
|
6437
|
+
* An identifier for the processing server.
|
|
6438
|
+
* Header-Key: n
|
|
6439
|
+
*/
|
|
6440
|
+
intermediaryIdentifier?: string;
|
|
6441
|
+
/**
|
|
6442
|
+
* The URL-encoded relative path to one or more objects which can
|
|
6443
|
+
* reasonably be expected to be requested by a client.
|
|
6444
|
+
* Header-Key: nor
|
|
6445
|
+
*/
|
|
6446
|
+
nextObjectResponse?: string;
|
|
6447
|
+
/**
|
|
6448
|
+
* If the next response will be a partial object response,
|
|
6449
|
+
* then this string denotes the byte range that will be returned.
|
|
6450
|
+
* Header-Key: nrr
|
|
6451
|
+
*/
|
|
6452
|
+
nextRangeResponse?: string;
|
|
6453
|
+
/**
|
|
6454
|
+
* The playback duration in milliseconds of the object.
|
|
6455
|
+
* Header-Key: d
|
|
6456
|
+
*/
|
|
6457
|
+
objectDuration?: number;
|
|
6458
|
+
/**
|
|
6459
|
+
* The media role of the current object being returned:
|
|
6460
|
+
* m = text file, such as a manifest or playlist
|
|
6461
|
+
* a = audio only
|
|
6462
|
+
* v = video only
|
|
6463
|
+
* av = muxed audio and video
|
|
6464
|
+
* i = init segment
|
|
6465
|
+
* c = caption or subtitle
|
|
6466
|
+
* tt = ISOBMFF timed text track
|
|
6467
|
+
* k = cryptographic key, license or certificate.
|
|
6468
|
+
* o = other
|
|
6469
|
+
* Header-Key: ot
|
|
6470
|
+
*/
|
|
6471
|
+
objectType?: string;
|
|
6472
|
+
/**
|
|
6473
|
+
* It should approximate the starting buffer of the intended players.
|
|
6474
|
+
* Header-Key: su
|
|
6475
|
+
*/
|
|
6476
|
+
startup?: boolean;
|
|
6477
|
+
/**
|
|
6478
|
+
* v = all segments are available – e.g., VoD.
|
|
6479
|
+
* l = segments become available over time – e.g., live.
|
|
6480
|
+
* Header-Key: st
|
|
6481
|
+
*/
|
|
6482
|
+
streamType?: string;
|
|
6483
|
+
/**
|
|
6484
|
+
* The streaming format that defines the current response.
|
|
6485
|
+
* d = MPEG DASH
|
|
6486
|
+
* h = HTTP Live Streaming (HLS)
|
|
6487
|
+
* s = Smooth Streaming
|
|
6488
|
+
* o = other
|
|
6489
|
+
* Header-Key: sf
|
|
6490
|
+
*/
|
|
6491
|
+
streamingFormat?: string;
|
|
6492
|
+
/**
|
|
6493
|
+
* The version of this specification used
|
|
6494
|
+
* for interpreting the defined key names and values.
|
|
6495
|
+
* Header-Key: v
|
|
6496
|
+
*/
|
|
6497
|
+
version?: number;
|
|
6498
|
+
}
|
|
6499
|
+
|
|
6327
6500
|
/**
|
|
6328
6501
|
* Container object that is send with state change events.
|
|
6329
6502
|
*/
|
|
@@ -6492,321 +6665,6 @@ export namespace clpp {
|
|
|
6492
6665
|
}
|
|
6493
6666
|
}
|
|
6494
6667
|
|
|
6495
|
-
namespace interstitial {
|
|
6496
|
-
/**
|
|
6497
|
-
* A function that can be used to modify the metadata of an interstitial cue.
|
|
6498
|
-
* It receives one argument of type {@link clpp.interstitial.PlaylistItem} and
|
|
6499
|
-
* returns a modified {@link clpp.interstitial.PlaylistItem}.
|
|
6500
|
-
*/
|
|
6501
|
-
export type AssetConverter = Function;
|
|
6502
|
-
|
|
6503
|
-
/**
|
|
6504
|
-
* Configuration options of the interstitial player.
|
|
6505
|
-
*/
|
|
6506
|
-
export type Options = {
|
|
6507
|
-
/**
|
|
6508
|
-
* The HTML element to be used as a container for video elements created
|
|
6509
|
-
* by the interstitial player. Typically this would be a div element.
|
|
6510
|
-
*/
|
|
6511
|
-
anchorEl: HTMLElement;
|
|
6512
|
-
/**
|
|
6513
|
-
* The configuration of the HLS asset to be played.
|
|
6514
|
-
*/
|
|
6515
|
-
config: clpp.PlayerConfiguration;
|
|
6516
|
-
/**
|
|
6517
|
-
* A function that can be used to modify the metadata of an interstitial cue.
|
|
6518
|
-
*/
|
|
6519
|
-
interstitialAssetConverter?: clpp.interstitial.AssetConverter;
|
|
6520
|
-
/**
|
|
6521
|
-
* A preroll margin. If an interstitial cue is within this many seconds of
|
|
6522
|
-
* the beginning of the playlist timeline, it is considered to be a preroll.
|
|
6523
|
-
*/
|
|
6524
|
-
prerollMarginSec?: number;
|
|
6525
|
-
/**
|
|
6526
|
-
* How many seconds on the timeline before the interstitial cue should
|
|
6527
|
-
* the cue be resolved and preloaded.
|
|
6528
|
-
*/
|
|
6529
|
-
resolutionOffsetSec?: number;
|
|
6530
|
-
/**
|
|
6531
|
-
* Configuration options of the Yospace plugin.
|
|
6532
|
-
*/
|
|
6533
|
-
yospace?: clpp.interstitial.YospacePluginOptions;
|
|
6534
|
-
}
|
|
6535
|
-
|
|
6536
|
-
/**
|
|
6537
|
-
* A MultiController item.
|
|
6538
|
-
* It consists of an asset/config, a player instance selected
|
|
6539
|
-
* to play this asset and the underlying video element to which the player is
|
|
6540
|
-
* attached.
|
|
6541
|
-
*/
|
|
6542
|
-
export type PlayerItem = {
|
|
6543
|
-
/**
|
|
6544
|
-
* Source configuration.
|
|
6545
|
-
*/
|
|
6546
|
-
config: clpp.PlayerConfiguration;
|
|
6547
|
-
/**
|
|
6548
|
-
* A unique ID.
|
|
6549
|
-
*/
|
|
6550
|
-
id: number;
|
|
6551
|
-
/**
|
|
6552
|
-
* A player instance.
|
|
6553
|
-
*/
|
|
6554
|
-
player: clpp.Player|null;
|
|
6555
|
-
/**
|
|
6556
|
-
* Whether the item is a primary item.
|
|
6557
|
-
*/
|
|
6558
|
-
primary?: boolean;
|
|
6559
|
-
/**
|
|
6560
|
-
* The role of the item.
|
|
6561
|
-
*/
|
|
6562
|
-
role: string;
|
|
6563
|
-
/**
|
|
6564
|
-
* The state of the item (e.g. 'preloading', 'preloaded', 'preload-failed',
|
|
6565
|
-
* 'loading', 'loaded', 'playing', 'idle').
|
|
6566
|
-
*/
|
|
6567
|
-
state: string;
|
|
6568
|
-
}
|
|
6569
|
-
|
|
6570
|
-
/**
|
|
6571
|
-
* A playable item of the interstitial player.
|
|
6572
|
-
* It can represent either the primary content or an interstitial asset.
|
|
6573
|
-
* This type extends {@link clpp.interstitial.MultiControllerInputItem}
|
|
6574
|
-
*/
|
|
6575
|
-
export type PlaylistItem = {
|
|
6576
|
-
/**
|
|
6577
|
-
* Configuration of the interstitial asset.
|
|
6578
|
-
*/
|
|
6579
|
-
config: clpp.PlayerConfiguration;
|
|
6580
|
-
/**
|
|
6581
|
-
* Sum of durations of this asset and all previous to it in the same list.
|
|
6582
|
-
*/
|
|
6583
|
-
cumulativeDuration: number;
|
|
6584
|
-
/**
|
|
6585
|
-
* Duration of the asset.
|
|
6586
|
-
*/
|
|
6587
|
-
duration: number;
|
|
6588
|
-
/**
|
|
6589
|
-
* ID of the interstitial asset.
|
|
6590
|
-
*/
|
|
6591
|
-
id: string;
|
|
6592
|
-
/**
|
|
6593
|
-
* ID of the interstitial to which this asset belongs.
|
|
6594
|
-
*/
|
|
6595
|
-
interstitialId: string;
|
|
6596
|
-
}
|
|
6597
|
-
|
|
6598
|
-
/**
|
|
6599
|
-
* A timeline cue representing one interstitial EXT-X-DATERANGE tag.
|
|
6600
|
-
*/
|
|
6601
|
-
export type UiCue = {
|
|
6602
|
-
/**
|
|
6603
|
-
* ID of the cue.
|
|
6604
|
-
*/
|
|
6605
|
-
cueId: string;
|
|
6606
|
-
/**
|
|
6607
|
-
* End time of the interstitial in seconds.
|
|
6608
|
-
*/
|
|
6609
|
-
endTime: number;
|
|
6610
|
-
/**
|
|
6611
|
-
* Placement of the cue.
|
|
6612
|
-
*/
|
|
6613
|
-
placement: string;
|
|
6614
|
-
/**
|
|
6615
|
-
* Duration of the primary content in seconds.
|
|
6616
|
-
*/
|
|
6617
|
-
primaryDuration: number;
|
|
6618
|
-
/**
|
|
6619
|
-
* Start time of the interstitial in seconds.
|
|
6620
|
-
*/
|
|
6621
|
-
startTime: number;
|
|
6622
|
-
}
|
|
6623
|
-
|
|
6624
|
-
/**
|
|
6625
|
-
* Configuration options of the Yospace plugin.
|
|
6626
|
-
*/
|
|
6627
|
-
export type YospacePluginOptions = {
|
|
6628
|
-
/**
|
|
6629
|
-
* True to enable the Yospace plugin.
|
|
6630
|
-
*/
|
|
6631
|
-
enabled: boolean;
|
|
6632
|
-
}
|
|
6633
|
-
|
|
6634
|
-
/**
|
|
6635
|
-
* Events fired by interstitial player.
|
|
6636
|
-
*/
|
|
6637
|
-
export enum Event {
|
|
6638
|
-
/**
|
|
6639
|
-
* Triggered when the resolution/preloading of an interstitial started.
|
|
6640
|
-
* In case of X-ASSET-LIST this is the same as x-asset-list-request-started,
|
|
6641
|
-
* in case of X-ASSET-URI this is the time when the media of the interstitial
|
|
6642
|
-
* asset started preloading.
|
|
6643
|
-
*/
|
|
6644
|
-
RESOLUTION_STARTED = "interstitial-preload-started",
|
|
6645
|
-
/**
|
|
6646
|
-
* Triggered when the X-ASSET-LIST request started.
|
|
6647
|
-
*/
|
|
6648
|
-
ASSET_LIST_STARTED = "x-asset-list-request-started",
|
|
6649
|
-
/**
|
|
6650
|
-
* Triggered when the X-ASSET-LIST request ended (even if it failed).
|
|
6651
|
-
*/
|
|
6652
|
-
ASSET_LIST_ENDED = "x-asset-list-request-ended",
|
|
6653
|
-
/**
|
|
6654
|
-
* Triggered when an interstitial ad break has been scheduled to be played.
|
|
6655
|
-
* This happens several seconds before the playback position reaches
|
|
6656
|
-
* interstitial date range. In case of preroll this happens immediately.
|
|
6657
|
-
*/
|
|
6658
|
-
SCHEDULED = "interstitial-scheduled",
|
|
6659
|
-
/**
|
|
6660
|
-
* Triggered when an interstitial break started.
|
|
6661
|
-
* One break contains one or more interstitial assets.
|
|
6662
|
-
*/
|
|
6663
|
-
STARTED = "interstitial-started",
|
|
6664
|
-
/**
|
|
6665
|
-
* Triggered when an interstitial break ended.
|
|
6666
|
-
*/
|
|
6667
|
-
ENDED = "interstitial-ended",
|
|
6668
|
-
/**
|
|
6669
|
-
* Triggered when the playback of one interstitial item started.
|
|
6670
|
-
* One interstitial ad break (one EXT-X-DATERANGE) can contain multiple
|
|
6671
|
-
* interstitial items.
|
|
6672
|
-
*/
|
|
6673
|
-
ITEM_STARTED = "interstitial-item-started",
|
|
6674
|
-
/**
|
|
6675
|
-
* Triggered when the primary player changed.
|
|
6676
|
-
* (Deprecated.)
|
|
6677
|
-
*/
|
|
6678
|
-
PRIMARY_PLAYER_CHANGED = "primary-player-changed",
|
|
6679
|
-
/**
|
|
6680
|
-
* Triggered when a new/different item started playing.
|
|
6681
|
-
* This could be either the first time something started playing or
|
|
6682
|
-
* a transition between primary and interstitial content or a transition
|
|
6683
|
-
* between two interstitial items.
|
|
6684
|
-
*/
|
|
6685
|
-
ITEM_CHANGED = "item-changed",
|
|
6686
|
-
/**
|
|
6687
|
-
* Triggered when playback started. The content which started playing can
|
|
6688
|
-
* either be primary content or an interstitial preroll.
|
|
6689
|
-
* In contrast {@link clpp.interstitial.Event.PRIMARY_STARTED} is triggered
|
|
6690
|
-
* when the primary content started playing which can be after a preroll.
|
|
6691
|
-
*/
|
|
6692
|
-
PLAYBACK_STARTED = "playback-started",
|
|
6693
|
-
/**
|
|
6694
|
-
* Triggered when playback ended. The content which ended playing can
|
|
6695
|
-
* either be primary content or an interstitial postroll.
|
|
6696
|
-
*/
|
|
6697
|
-
PLAYBACK_ENDED = "playback-ended",
|
|
6698
|
-
/**
|
|
6699
|
-
* Triggered when primary content playback started.
|
|
6700
|
-
*/
|
|
6701
|
-
PRIMARY_STARTED = "primary-started",
|
|
6702
|
-
/**
|
|
6703
|
-
* Triggered when primary content playback ended.
|
|
6704
|
-
*/
|
|
6705
|
-
PRIMARY_ENDED = "primary-ended",
|
|
6706
|
-
/**
|
|
6707
|
-
* Triggered when interstitial cues changed.
|
|
6708
|
-
* For VOD this is triggered only once during load.
|
|
6709
|
-
*/
|
|
6710
|
-
CUES_CHANGED = "cues-changed",
|
|
6711
|
-
}
|
|
6712
|
-
|
|
6713
|
-
/**
|
|
6714
|
-
* A player that plays HLS assets containing interstitials.
|
|
6715
|
-
* It fires the following events {@link clpp.interstitial.Event}.
|
|
6716
|
-
* Supported parts for the HLS spec:
|
|
6717
|
-
*
|
|
6718
|
-
* X-ASSET-LIST, X-ASSET-URI, X-RESUME-OFFSET, X-PLAYOUT-LIMIT
|
|
6719
|
-
*
|
|
6720
|
-
* Limitations:
|
|
6721
|
-
*
|
|
6722
|
-
* Only supports VOD.
|
|
6723
|
-
* Interstitials must not be too close to each other.
|
|
6724
|
-
* Interstitials cannot overlap.
|
|
6725
|
-
* No error handling (for when some asset/list fails to load).
|
|
6726
|
-
* No support for #EXT-X-DATERANGE.CUE
|
|
6727
|
-
* No support for X-RESTRICT
|
|
6728
|
-
* No support for _HLS_start_offset query in live (because no support
|
|
6729
|
-
* for live)
|
|
6730
|
-
* No support for _HLS_primary_id
|
|
6731
|
-
*
|
|
6732
|
-
*/
|
|
6733
|
-
export class Player {
|
|
6734
|
-
/**
|
|
6735
|
-
* A player that plays HLS assets containing interstitials.
|
|
6736
|
-
* It fires the following events {@link clpp.interstitial.Event}.
|
|
6737
|
-
* Supported parts for the HLS spec:
|
|
6738
|
-
*
|
|
6739
|
-
* X-ASSET-LIST, X-ASSET-URI, X-RESUME-OFFSET, X-PLAYOUT-LIMIT
|
|
6740
|
-
*
|
|
6741
|
-
* Limitations:
|
|
6742
|
-
*
|
|
6743
|
-
* Only supports VOD.
|
|
6744
|
-
* Interstitials must not be too close to each other.
|
|
6745
|
-
* Interstitials cannot overlap.
|
|
6746
|
-
* No error handling (for when some asset/list fails to load).
|
|
6747
|
-
* No support for #EXT-X-DATERANGE.CUE
|
|
6748
|
-
* No support for X-RESTRICT
|
|
6749
|
-
* No support for _HLS_start_offset query in live (because no support
|
|
6750
|
-
* for live)
|
|
6751
|
-
* No support for _HLS_primary_id
|
|
6752
|
-
*
|
|
6753
|
-
*
|
|
6754
|
-
* @param options configuration options
|
|
6755
|
-
*/
|
|
6756
|
-
constructor(options: clpp.interstitial.Options);
|
|
6757
|
-
/**
|
|
6758
|
-
* Request that this object be destroyed, releasing all resources and shutting
|
|
6759
|
-
* down all operations. Returns a Promise which is resolved when destruction
|
|
6760
|
-
* is complete. This Promise should never be rejected.
|
|
6761
|
-
*/
|
|
6762
|
-
destroy(): Promise<void>;
|
|
6763
|
-
/**
|
|
6764
|
-
* Get interstitial cues of the loaded asset.
|
|
6765
|
-
*/
|
|
6766
|
-
getCues(): Array<clpp.interstitial.UiCue>;
|
|
6767
|
-
/**
|
|
6768
|
-
* Get the current item.
|
|
6769
|
-
*/
|
|
6770
|
-
getCurrentItem(): clpp.interstitial.PlayerItem|null;
|
|
6771
|
-
/**
|
|
6772
|
-
* Get the current player.
|
|
6773
|
-
*/
|
|
6774
|
-
getCurrentPlayer(): clpp.Player|null;
|
|
6775
|
-
/**
|
|
6776
|
-
* Get the current playback position.
|
|
6777
|
-
* This is either of the position in the primary content or in
|
|
6778
|
-
* the interstitial asset depending on which one is currently playing.
|
|
6779
|
-
*/
|
|
6780
|
-
getPosition(): number|null;
|
|
6781
|
-
/**
|
|
6782
|
-
* Get the Yospace Ad Management session created by the last {@link load} or
|
|
6783
|
-
* {@link loadPaused} call.
|
|
6784
|
-
* This is only available if the Yospace plugin is enabled.
|
|
6785
|
-
*/
|
|
6786
|
-
getYospaceSession(): any;
|
|
6787
|
-
/**
|
|
6788
|
-
* Load and play the asset.
|
|
6789
|
-
*
|
|
6790
|
-
* @param config configuration of the HLS asset
|
|
6791
|
-
*/
|
|
6792
|
-
load(config: clpp.PlayerConfiguration): Promise<void>;
|
|
6793
|
-
/**
|
|
6794
|
-
* Load the asset and keep it paused.
|
|
6795
|
-
*
|
|
6796
|
-
* @param config configuration of the HLS asset
|
|
6797
|
-
*/
|
|
6798
|
-
loadPaused(config: clpp.PlayerConfiguration): Promise<void>;
|
|
6799
|
-
/**
|
|
6800
|
-
* Unload the source and release resources.
|
|
6801
|
-
*/
|
|
6802
|
-
unload(): Promise<void>;
|
|
6803
|
-
/**
|
|
6804
|
-
* Unpause the playback.
|
|
6805
|
-
*/
|
|
6806
|
-
unpause(): Promise<void>;
|
|
6807
|
-
}
|
|
6808
|
-
}
|
|
6809
|
-
|
|
6810
6668
|
namespace log {
|
|
6811
6669
|
/**
|
|
6812
6670
|
* Implement an interceptor and add it using {@link clpp.log#addInterceptor}
|
|
@@ -8078,6 +7936,20 @@ export namespace clpp {
|
|
|
8078
7936
|
}
|
|
8079
7937
|
}
|
|
8080
7938
|
|
|
7939
|
+
namespace polyfill {
|
|
7940
|
+
/**
|
|
7941
|
+
* Install all polyfills.
|
|
7942
|
+
*/
|
|
7943
|
+
function installAll(): void;
|
|
7944
|
+
/**
|
|
7945
|
+
* Registers a new polyfill to be installed.
|
|
7946
|
+
*
|
|
7947
|
+
* @param polyfill
|
|
7948
|
+
* @param priority An optional number priority. Higher priorities
|
|
7949
|
+
* will be executed before lower priority ones. Default is 0.
|
|
7950
|
+
*/
|
|
7951
|
+
function register(polyfill: Function, priority?: number): void;}
|
|
7952
|
+
|
|
8081
7953
|
namespace smooth {
|
|
8082
7954
|
export class SmoothComponent {
|
|
8083
7955
|
|
|
@@ -8787,6 +8659,129 @@ export namespace clpp {
|
|
|
8787
8659
|
|
|
8788
8660
|
}
|
|
8789
8661
|
}
|
|
8662
|
+
|
|
8663
|
+
namespace dom {
|
|
8664
|
+
/**
|
|
8665
|
+
* Creates an element, and cast the type from Element to HTMLElement.
|
|
8666
|
+
*/
|
|
8667
|
+
function createHTMLElement(tagName: string): HTMLElement;}
|
|
8668
|
+
|
|
8669
|
+
namespace media {
|
|
8670
|
+
/**
|
|
8671
|
+
* Tries to detect the media type from the URL.
|
|
8672
|
+
* i.e. detecting whether it is an MP4, DASH or HLS, manifest URL.
|
|
8673
|
+
*
|
|
8674
|
+
* @param url The source URL
|
|
8675
|
+
*/
|
|
8676
|
+
function detectType(url: string): clpp.Type|null;}
|
|
8677
|
+
|
|
8678
|
+
namespace obj {
|
|
8679
|
+
/**
|
|
8680
|
+
* Clones the given object.
|
|
8681
|
+
* This creates a copy for primitives or plain objects.
|
|
8682
|
+
*
|
|
8683
|
+
* @param item The item to clone
|
|
8684
|
+
*/
|
|
8685
|
+
function cloneItem<T>(item: T): T;
|
|
8686
|
+
/**
|
|
8687
|
+
* Merge multiple plain objects from left to right.
|
|
8688
|
+
* This copies over primitive values, plain Objects,
|
|
8689
|
+
* functions, DOM Elements and arrays.
|
|
8690
|
+
* If an item is null of undefined, it is ignored.
|
|
8691
|
+
*
|
|
8692
|
+
* @param args two or more objects to be merged
|
|
8693
|
+
*/
|
|
8694
|
+
function merge(...args: any[]): Record<string,any>|null;}
|
|
8695
|
+
|
|
8696
|
+
namespace strings {
|
|
8697
|
+
/**
|
|
8698
|
+
* Takes a bitrate and returns a string representation.
|
|
8699
|
+
* Units are in bps, Kbps, Mbps.
|
|
8700
|
+
*
|
|
8701
|
+
* @param bps The bitrate in bps
|
|
8702
|
+
*/
|
|
8703
|
+
function bitrateToString(bps: number|string|null|undefined): string;
|
|
8704
|
+
/**
|
|
8705
|
+
* Translates a duration in seconds to a human readable format.
|
|
8706
|
+
* You can use the following format specifiers:
|
|
8707
|
+
*
|
|
8708
|
+
* `%h` for Hours
|
|
8709
|
+
* `%m` for Minutes
|
|
8710
|
+
* `%s` for Seconds
|
|
8711
|
+
*
|
|
8712
|
+
* The formatters can be repeated to pad the output.
|
|
8713
|
+
* For example, `'%m'` will return '1' if you pass 60 seconds,
|
|
8714
|
+
* while `'%mm'` will left pad the output and return '01'.
|
|
8715
|
+
*
|
|
8716
|
+
* @param duration The duration in seconds
|
|
8717
|
+
* @param opt_format The output format
|
|
8718
|
+
*/
|
|
8719
|
+
function durationToString(duration: number, opt_format?: string): string;
|
|
8720
|
+
/**
|
|
8721
|
+
* Returns true if the given string ends with the given query.
|
|
8722
|
+
*
|
|
8723
|
+
* @param str The source string which we search in
|
|
8724
|
+
* @param query The target string that we search for
|
|
8725
|
+
*/
|
|
8726
|
+
function endsWith(str: string, query: string): boolean;
|
|
8727
|
+
/**
|
|
8728
|
+
* Creates a string from the given buffer, auto-detecting the encoding.
|
|
8729
|
+
* If it cannot detect the encoding, it will throw an exception.
|
|
8730
|
+
*/
|
|
8731
|
+
function fromBytesAutoDetect(sourceData: BufferSource|string, escapeStr?: boolean): string;
|
|
8732
|
+
/**
|
|
8733
|
+
* Creates a string from the given buffer as UTF-8 encoding.
|
|
8734
|
+
*
|
|
8735
|
+
* @param data binary data encoded as UTF-8
|
|
8736
|
+
*/
|
|
8737
|
+
function fromUtf8(data: BufferSource|null): string;
|
|
8738
|
+
/**
|
|
8739
|
+
* Generate the hash code from the given input.
|
|
8740
|
+
*
|
|
8741
|
+
* @param str the input string
|
|
8742
|
+
*/
|
|
8743
|
+
function hashCode(str: string): number;
|
|
8744
|
+
/**
|
|
8745
|
+
* Returns true if the given string starts with the given query.
|
|
8746
|
+
*
|
|
8747
|
+
* @param str The source string which we search in
|
|
8748
|
+
* @param query The target string that we search for
|
|
8749
|
+
*/
|
|
8750
|
+
function startsWith(str: string, query: string): boolean;
|
|
8751
|
+
/**
|
|
8752
|
+
* Converts an ASCII string to a byte array.
|
|
8753
|
+
* ASCII is converted using the specified number of bytes per character.
|
|
8754
|
+
*
|
|
8755
|
+
* @param s The string
|
|
8756
|
+
* @param opt_size Number of bytes per character
|
|
8757
|
+
*/
|
|
8758
|
+
function toByteArray(s: string, opt_size?: number): ArrayBuffer;
|
|
8759
|
+
/**
|
|
8760
|
+
* Creates a ArrayBuffer from the given string, converting to UTF-16 encoding.
|
|
8761
|
+
*/
|
|
8762
|
+
function toUtf16(str: string, littleEndian: boolean): ArrayBuffer;
|
|
8763
|
+
/**
|
|
8764
|
+
* Creates a Uint8Array from the given string, converting to UTF-8 encoding.
|
|
8765
|
+
*/
|
|
8766
|
+
function toUtf8(str: string): Uint8Array;}
|
|
8767
|
+
|
|
8768
|
+
namespace url {
|
|
8769
|
+
/**
|
|
8770
|
+
* Encodes the given dictionary to URL query parameters. Both keys and
|
|
8771
|
+
* values will be URI encoded so they should be provided un-encoded.
|
|
8772
|
+
* You can optionally specify an array of keys that should be included. If
|
|
8773
|
+
* specified, only those keys will be included in the resulting query string.
|
|
8774
|
+
* Please note that unless filter keys are specified, the keys will be
|
|
8775
|
+
* appended in sort order. This is necessary to ensure consistent results
|
|
8776
|
+
* across browsers.
|
|
8777
|
+
*
|
|
8778
|
+
* @param queryParams The query parameters
|
|
8779
|
+
* @param opt_ignoreQuestionMark If true, the result will not start
|
|
8780
|
+
* with a '?'
|
|
8781
|
+
* @param opt_keys Optionally only contain the keys in this
|
|
8782
|
+
* array. All other query parameters will be omitted
|
|
8783
|
+
*/
|
|
8784
|
+
function queryString(queryParams: Record<string, string>, opt_ignoreQuestionMark?: boolean, opt_keys?: Array<string>): string;}
|
|
8790
8785
|
}
|
|
8791
8786
|
|
|
8792
8787
|
namespace verimatrix {
|