@castlabs/prestoplay 6.14.1 → 6.16.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 +28 -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 +114 -112
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +553 -538
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +74 -73
- package/cjs/cl.externs.js +193 -58
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +69 -69
- 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 +368 -264
- 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.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +28 -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 +20 -20
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +89 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +455 -443
- package/cl.crypto.js +9 -9
- package/cl.dash.js +70 -68
- package/cl.externs.js +189 -58
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +71 -71
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +318 -236
- 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.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 +15 -15
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/package.json +1 -1
- package/typings.d.ts +393 -57
package/typings.d.ts
CHANGED
|
@@ -892,6 +892,22 @@ export namespace clpp {
|
|
|
892
892
|
xlinkFailGracefully: boolean;
|
|
893
893
|
}
|
|
894
894
|
|
|
895
|
+
/**
|
|
896
|
+
* Media source configuration.
|
|
897
|
+
*/
|
|
898
|
+
export type MediaSourceConfiguration = {
|
|
899
|
+
/**
|
|
900
|
+
* The switching
|
|
901
|
+
* strategy determines how to handle codec changes during playback. The `SMOOTH`
|
|
902
|
+
* strategy uses `SourceBuffer.changeType()` - if it’s available and reliably
|
|
903
|
+
* supported on a device - to dynamically switch between streams encoded with
|
|
904
|
+
* different codecs. The `PREVENT` strategy, which is the default, actively
|
|
905
|
+
* tries to prevent scenarios where different codecs are available for
|
|
906
|
+
* switching, whether through ABR or user selection.
|
|
907
|
+
*/
|
|
908
|
+
codecSwitchingStrategy: clpp.CodecSwitchingStrategy;
|
|
909
|
+
}
|
|
910
|
+
|
|
895
911
|
/**
|
|
896
912
|
* Mux Data plugin configuration.
|
|
897
913
|
*/
|
|
@@ -1161,6 +1177,13 @@ export namespace clpp {
|
|
|
1161
1177
|
* HtmlCue component configuration.
|
|
1162
1178
|
*/
|
|
1163
1179
|
htmlcue?: Partial<clpp.HtmlCueConfiguration>;
|
|
1180
|
+
/**
|
|
1181
|
+
* A unique identifier of this configuration object.
|
|
1182
|
+
* This attribute is optional, except for configuration objects passed to
|
|
1183
|
+
* {@link clpp.plist.ScPlaylist} for which the ID is mandatory, since we
|
|
1184
|
+
* need a clear way to distinguish different items of the playlist.
|
|
1185
|
+
*/
|
|
1186
|
+
id?: string;
|
|
1164
1187
|
/**
|
|
1165
1188
|
* Ads plugin configuration.
|
|
1166
1189
|
*/
|
|
@@ -1186,6 +1209,10 @@ export namespace clpp {
|
|
|
1186
1209
|
* Manifest configuration and settings.
|
|
1187
1210
|
*/
|
|
1188
1211
|
manifest?: Partial<clpp.ManifestConfiguration>;
|
|
1212
|
+
/**
|
|
1213
|
+
* Media source configuration and settings.
|
|
1214
|
+
*/
|
|
1215
|
+
mediaSource?: Partial<clpp.MediaSourceConfiguration>;
|
|
1189
1216
|
/**
|
|
1190
1217
|
* Defaults to undefined.
|
|
1191
1218
|
*
|
|
@@ -1204,6 +1231,10 @@ export namespace clpp {
|
|
|
1204
1231
|
* back into foreground.
|
|
1205
1232
|
*/
|
|
1206
1233
|
pauseWhenInBackground?: boolean;
|
|
1234
|
+
/**
|
|
1235
|
+
* Playlist-related configuration.
|
|
1236
|
+
*/
|
|
1237
|
+
playlist?: Partial<clpp.PlaylistConfiguration>;
|
|
1207
1238
|
/**
|
|
1208
1239
|
* Defaults to `false`.
|
|
1209
1240
|
*
|
|
@@ -1290,8 +1321,7 @@ export namespace clpp {
|
|
|
1290
1321
|
*/
|
|
1291
1322
|
safari?: Partial<clpp.SafariConfiguration>;
|
|
1292
1323
|
/**
|
|
1293
|
-
* SIMID plugin
|
|
1294
|
-
* configuration
|
|
1324
|
+
* SIMID plugin configuration
|
|
1295
1325
|
*/
|
|
1296
1326
|
simid?: Partial<clpp.SimidConfiguration>;
|
|
1297
1327
|
/**
|
|
@@ -1391,6 +1421,49 @@ export namespace clpp {
|
|
|
1391
1421
|
webOSStartupPatch: boolean;
|
|
1392
1422
|
}
|
|
1393
1423
|
|
|
1424
|
+
/**
|
|
1425
|
+
* Playlist-related configuration.
|
|
1426
|
+
*/
|
|
1427
|
+
export type PlaylistConfiguration = {
|
|
1428
|
+
/**
|
|
1429
|
+
* Defaults to "VOD".
|
|
1430
|
+
*
|
|
1431
|
+
* This option applies to the single-controller playlist and the accepted
|
|
1432
|
+
* values are "VOD" and "DVR". In "VOD" mode the playlist can contain
|
|
1433
|
+
* VOD items only. In "DVR" mode the playlist can contain VOD items and
|
|
1434
|
+
* one DVR item at the end of the playlist.
|
|
1435
|
+
*/
|
|
1436
|
+
content?: string;
|
|
1437
|
+
/**
|
|
1438
|
+
* Defaults to false.
|
|
1439
|
+
*
|
|
1440
|
+
* This option applies to the single-controller playlist. If true, the
|
|
1441
|
+
* timeline will be cropped based on the values of `startTime` and `endTime`.
|
|
1442
|
+
*/
|
|
1443
|
+
cropTimeline?: boolean;
|
|
1444
|
+
/**
|
|
1445
|
+
* This option applies to the single-controller playlist. It is the time
|
|
1446
|
+
* at which the playlist should stop. The time is relative to the
|
|
1447
|
+
* start of the first playlist item and may span several items.
|
|
1448
|
+
*/
|
|
1449
|
+
endTime?: number;
|
|
1450
|
+
/**
|
|
1451
|
+
* This option applies to the single-controller playlist. IT is the time
|
|
1452
|
+
* within the first playlist item at which the playlist should start
|
|
1453
|
+
* playback. The time is relative to the start of the first playlist item.
|
|
1454
|
+
*/
|
|
1455
|
+
startTime?: number;
|
|
1456
|
+
/**
|
|
1457
|
+
* Defaults to "basic".
|
|
1458
|
+
*
|
|
1459
|
+
* This option applies to the single-controller playlist and the accepted
|
|
1460
|
+
* values are "basic" and "flat". In "basic" mode each item has its own
|
|
1461
|
+
* timeline, in "flat" mode all items of the playlist are concatenated into
|
|
1462
|
+
* a single timeline.
|
|
1463
|
+
*/
|
|
1464
|
+
timeline?: string;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1394
1467
|
/**
|
|
1395
1468
|
* Playlist item.
|
|
1396
1469
|
*/
|
|
@@ -2240,14 +2313,22 @@ export namespace clpp {
|
|
|
2240
2313
|
* EventStream element. In HLS this is the EXT-X-DATERANGE tag.
|
|
2241
2314
|
*/
|
|
2242
2315
|
export type TimelineCue = {
|
|
2316
|
+
/**
|
|
2317
|
+
* ID of the configuration object of the asset to which this cue belongs
|
|
2318
|
+
* if it is defined in {@link clpp.PlayerConfiguration}.
|
|
2319
|
+
*/
|
|
2320
|
+
configurationId?: string;
|
|
2243
2321
|
/**
|
|
2244
2322
|
* The presentation time (in seconds) that the cue should end.
|
|
2323
|
+
* Allowed values follow the same rules as startTime. It is possible
|
|
2324
|
+
* for endTime and startTime to be equal, in which case the cue is
|
|
2325
|
+
* considered to be a discrete point on the timeline.
|
|
2245
2326
|
*/
|
|
2246
2327
|
endTime: number;
|
|
2247
2328
|
/**
|
|
2248
|
-
* The XML element that defines the Event.
|
|
2329
|
+
* The XML element that defines the Event. Defined only for DASH.
|
|
2249
2330
|
*/
|
|
2250
|
-
eventElement: Element;
|
|
2331
|
+
eventElement: Element|null;
|
|
2251
2332
|
/**
|
|
2252
2333
|
* Specifies an identifier for this instance of the cue.
|
|
2253
2334
|
*/
|
|
@@ -2258,6 +2339,11 @@ export namespace clpp {
|
|
|
2258
2339
|
schemeIdUri: string;
|
|
2259
2340
|
/**
|
|
2260
2341
|
* The presentation time (in seconds) that the cue should start.
|
|
2342
|
+
* Specifically for VOD streams the startTime is relative to the start of
|
|
2343
|
+
* the stream, so the value is something between 0 and duration.
|
|
2344
|
+
* For live streams the startTime is absolute, so the value is something
|
|
2345
|
+
* between the start of the first period and the end of the last period
|
|
2346
|
+
* of the stream.
|
|
2261
2347
|
*/
|
|
2262
2348
|
startTime: number;
|
|
2263
2349
|
/**
|
|
@@ -2785,6 +2871,32 @@ export namespace clpp {
|
|
|
2785
2871
|
severity: clpp.Error.Severity;
|
|
2786
2872
|
}
|
|
2787
2873
|
|
|
2874
|
+
/**
|
|
2875
|
+
* Codec switching strategy.
|
|
2876
|
+
*/
|
|
2877
|
+
export enum CodecSwitchingStrategy {
|
|
2878
|
+
/**
|
|
2879
|
+
* Prevent codec switching. This strategy actively tries to prevent a
|
|
2880
|
+
* situation where different codecs are available for switching, whether by
|
|
2881
|
+
* ABR or user selection. It select only the codecs that are possible to adapt
|
|
2882
|
+
* within the period and between periods.
|
|
2883
|
+
*/
|
|
2884
|
+
PREVENT = "prevent",
|
|
2885
|
+
/**
|
|
2886
|
+
* Enable codec switching using `SourceBuffer.changeType()`. This checks if
|
|
2887
|
+
* `SourceBuffer.changeType()` is available and reliably supported on a
|
|
2888
|
+
* device, and if so, uses it.
|
|
2889
|
+
* Note: Some devices expose the `MediaSource.changeType()` API but are
|
|
2890
|
+
* known to have unreliable support, which can lead to issues like playback
|
|
2891
|
+
* hanging after the `changeType()` request. Currently, we explicitly include
|
|
2892
|
+
* Tizen 6.0 and 6.5 in the list of devices with problematic `changeType()`
|
|
2893
|
+
* support and disable the use of the `SMOOTH` strategy to prevent potential
|
|
2894
|
+
* issues. We are also aware that some Chromecast devices and Edge on Windows
|
|
2895
|
+
* have similar problems, so these may be added to the list in the future.
|
|
2896
|
+
*/
|
|
2897
|
+
SMOOTH = "smooth",
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2788
2900
|
/**
|
|
2789
2901
|
* Speed-up mode to use during trick play.
|
|
2790
2902
|
*/
|
|
@@ -3124,6 +3236,28 @@ export namespace clpp {
|
|
|
3124
3236
|
* Triggered when a playlist item has been added, removed or moved.
|
|
3125
3237
|
*/
|
|
3126
3238
|
PLAYLIST_MODIFIED = "playlist-modified",
|
|
3239
|
+
/**
|
|
3240
|
+
* Triggered when a new timeline window has been added to the timeline of
|
|
3241
|
+
* a single-controller playlist, or when the duration of an existing timeline
|
|
3242
|
+
* window changes.
|
|
3243
|
+
*/
|
|
3244
|
+
SC_PLAYLIST_TIMELINE_CHANGED = "sc-playlist-timeline-changed",
|
|
3245
|
+
/**
|
|
3246
|
+
* Triggered when the currently active/selected item of a single-controller
|
|
3247
|
+
* playlist changes.
|
|
3248
|
+
*/
|
|
3249
|
+
SC_PLAYLIST_ITEM_CHANGED = "sc-playlist-item-changed",
|
|
3250
|
+
/**
|
|
3251
|
+
* Triggered when playback reaches the end of the last item of
|
|
3252
|
+
* a single-controller playlist, or if `playlist.endTime` is configured
|
|
3253
|
+
* then it's triggered when the end time is reached.
|
|
3254
|
+
*/
|
|
3255
|
+
SC_PLAYLIST_ENDED = "sc-playlist-ended",
|
|
3256
|
+
/**
|
|
3257
|
+
* Triggered when the last item of the playlist is an EVENT stream and it
|
|
3258
|
+
* turns from dynamic to static.
|
|
3259
|
+
*/
|
|
3260
|
+
SC_PLAYLIST_LIVE_TURNED_STATIC = "sc-playlist-live-turned-static",
|
|
3127
3261
|
/**
|
|
3128
3262
|
* Triggered when CDN switch was successful.
|
|
3129
3263
|
*/
|
|
@@ -4845,6 +4979,21 @@ export namespace clpp {
|
|
|
4845
4979
|
* E.g. it is not a direct parent of the video element.
|
|
4846
4980
|
*/
|
|
4847
4981
|
INVALID_CONTAINER_ELEMENT = 7006,
|
|
4982
|
+
/**
|
|
4983
|
+
* Error raised when a method is passed an invalid argument.
|
|
4984
|
+
*/
|
|
4985
|
+
INVALID_ARGUMENT = 7007,
|
|
4986
|
+
/**
|
|
4987
|
+
* Error raised when two methods which depend on each other are called
|
|
4988
|
+
* in the wrong order.
|
|
4989
|
+
*/
|
|
4990
|
+
WRONG_ORDER_OF_OPERATIONS = 7008,
|
|
4991
|
+
/**
|
|
4992
|
+
* Error raised when calling a method which is not supported or passing
|
|
4993
|
+
* arguments or a configuration of arguments that are not supported. This
|
|
4994
|
+
* may also be platform dependent.
|
|
4995
|
+
*/
|
|
4996
|
+
NOT_SUPPORTED = 7009,
|
|
4848
4997
|
/**
|
|
4849
4998
|
* The provided {@link clpp.PlayerConfiguration} is invalid.
|
|
4850
4999
|
*/
|
|
@@ -6427,57 +6576,6 @@ export namespace clpp {
|
|
|
6427
6576
|
*
|
|
6428
6577
|
*/
|
|
6429
6578
|
export class Player {
|
|
6430
|
-
/**
|
|
6431
|
-
* Player that plays HLS interstitials.
|
|
6432
|
-
* Fires events @see {@link clpp.interstitial.Event}.
|
|
6433
|
-
* Support:
|
|
6434
|
-
*
|
|
6435
|
-
* X-ASSET-LIST, X-ASSET-URI, X-RESUME-OFFSET, X-PLAYOUT-LIMIT
|
|
6436
|
-
*
|
|
6437
|
-
* Limitations:
|
|
6438
|
-
*
|
|
6439
|
-
*
|
|
6440
|
-
* Only supports VOD.
|
|
6441
|
-
*
|
|
6442
|
-
*
|
|
6443
|
-
* Interstitials must not be too close to each other.
|
|
6444
|
-
*
|
|
6445
|
-
*
|
|
6446
|
-
* Interstitials cannot overlap.
|
|
6447
|
-
*
|
|
6448
|
-
*
|
|
6449
|
-
* No error handling (for when some asset/list fails to load).
|
|
6450
|
-
*
|
|
6451
|
-
*
|
|
6452
|
-
* No support for #EXT-X-DATERANGE.CUE
|
|
6453
|
-
*
|
|
6454
|
-
*
|
|
6455
|
-
* No support for X-RESTRICT
|
|
6456
|
-
*
|
|
6457
|
-
*
|
|
6458
|
-
* No support for _HLS_start_offset query in live (because no support
|
|
6459
|
-
* for live)
|
|
6460
|
-
*
|
|
6461
|
-
*
|
|
6462
|
-
* No support for _HLS_primary_id
|
|
6463
|
-
*
|
|
6464
|
-
*
|
|
6465
|
-
* TODO configurable re-play of interstitial
|
|
6466
|
-
*
|
|
6467
|
-
*
|
|
6468
|
-
* TODO configurable skipping
|
|
6469
|
-
*
|
|
6470
|
-
*
|
|
6471
|
-
* TODO support live primary asset (working with position)
|
|
6472
|
-
*
|
|
6473
|
-
*
|
|
6474
|
-
* Idea: if MultiController does not release primary player and just stops
|
|
6475
|
-
* it, we can save some network requests and context changes. Currently we
|
|
6476
|
-
* release the primary player.
|
|
6477
|
-
*
|
|
6478
|
-
*
|
|
6479
|
-
*/
|
|
6480
|
-
constructor(options: clpp.interstitial.Options);
|
|
6481
6579
|
/**
|
|
6482
6580
|
* Request that this object be destroyed, releasing all resources and shutting
|
|
6483
6581
|
* down all operations. Returns a Promise which is resolved when destruction
|
|
@@ -6709,6 +6807,86 @@ export namespace clpp {
|
|
|
6709
6807
|
}
|
|
6710
6808
|
}
|
|
6711
6809
|
|
|
6810
|
+
namespace media {
|
|
6811
|
+
export class Timeline {
|
|
6812
|
+
/**
|
|
6813
|
+
* Get the currently active window of the timeline.
|
|
6814
|
+
*
|
|
6815
|
+
* @example // Get the current timeline window.
|
|
6816
|
+
*
|
|
6817
|
+
* const timelineWindow = timeline.getCurrentWindow();
|
|
6818
|
+
*/
|
|
6819
|
+
getCurrentWindow(): clpp.media.TimelineWindow|null;
|
|
6820
|
+
/**
|
|
6821
|
+
* Get the index of the currently active window of the timeline.
|
|
6822
|
+
*
|
|
6823
|
+
* @example // Get the index of the current timeline window.
|
|
6824
|
+
*
|
|
6825
|
+
* const index = timeline.getCurrentWindowIndex(); // 0
|
|
6826
|
+
*/
|
|
6827
|
+
getCurrentWindowIndex(): number;
|
|
6828
|
+
/**
|
|
6829
|
+
* Get a window of the timeline at the given index.
|
|
6830
|
+
*
|
|
6831
|
+
* @example // Get timeline window at index.
|
|
6832
|
+
*
|
|
6833
|
+
* const timelineWindow = timeline.getWindow(0);
|
|
6834
|
+
*/
|
|
6835
|
+
getWindow(index: number): clpp.media.TimelineWindow|null;
|
|
6836
|
+
/**
|
|
6837
|
+
* Get the number of windows in the timeline.
|
|
6838
|
+
*
|
|
6839
|
+
* @example // Get the number of timeline windows.
|
|
6840
|
+
*
|
|
6841
|
+
* const count = timeline.getWindowCount(); // 4
|
|
6842
|
+
*/
|
|
6843
|
+
getWindowCount(): number;
|
|
6844
|
+
/**
|
|
6845
|
+
* Get all the windows of the timeline.
|
|
6846
|
+
*
|
|
6847
|
+
* @example // Get all timeline windows.
|
|
6848
|
+
*
|
|
6849
|
+
* const windows = timeline.getWindows(); // [...]
|
|
6850
|
+
*/
|
|
6851
|
+
getWindows(): Array<clpp.media.TimelineWindow>;
|
|
6852
|
+
}
|
|
6853
|
+
|
|
6854
|
+
export class TimelineWindow {
|
|
6855
|
+
/**
|
|
6856
|
+
* Get the duration of the timeline window.
|
|
6857
|
+
*
|
|
6858
|
+
* @example // Get the duration.
|
|
6859
|
+
*
|
|
6860
|
+
* const duration = timelineWindow.getDuration(); // 600
|
|
6861
|
+
*/
|
|
6862
|
+
getDuration(): number;
|
|
6863
|
+
/**
|
|
6864
|
+
* Get the ID of the timeline window.
|
|
6865
|
+
*
|
|
6866
|
+
* @example // Get the ID.
|
|
6867
|
+
*
|
|
6868
|
+
* const id = timelineWindow.getId(); // "asset1"
|
|
6869
|
+
*/
|
|
6870
|
+
getId(): string;
|
|
6871
|
+
/**
|
|
6872
|
+
* Get the start time of the timeline window.
|
|
6873
|
+
*
|
|
6874
|
+
* @example // Get the start of the window.
|
|
6875
|
+
*
|
|
6876
|
+
* const startTime = timelineWindow.getStart(); // 400
|
|
6877
|
+
*/
|
|
6878
|
+
getStart(): number;
|
|
6879
|
+
/**
|
|
6880
|
+
* Check whether the timeline window is static or dynamic.
|
|
6881
|
+
*
|
|
6882
|
+
* @example // Check if the window is dynamic.
|
|
6883
|
+
*
|
|
6884
|
+
* const dynamic = timelineWindow.isDynamic(); // false
|
|
6885
|
+
*/
|
|
6886
|
+
isDynamic(): boolean;
|
|
6887
|
+
}
|
|
6888
|
+
}
|
|
6889
|
+
|
|
6712
6890
|
namespace muxdata {
|
|
6713
6891
|
export class MuxDataPlugin {
|
|
6714
6892
|
static Id: string;
|
|
@@ -7550,6 +7728,164 @@ export namespace clpp {
|
|
|
7550
7728
|
*/
|
|
7551
7729
|
setItems(configs: Array<clpp.PlayerConfiguration>): void;
|
|
7552
7730
|
}
|
|
7731
|
+
|
|
7732
|
+
/**
|
|
7733
|
+
* The single-controller playlist is intended for smooth continuous
|
|
7734
|
+
* back-to-back playback of multiple items. The playlist class inherits from
|
|
7735
|
+
* {@link clpp.Player} so all methods defined there can also be called on
|
|
7736
|
+
* the playlist instance (e.g. {@link clpp.Player#on|on()},
|
|
7737
|
+
* {@link clpp.Player#off|off()}, {@link clpp.Player#getPosition|getPosition()},
|
|
7738
|
+
* {@link clpp.Player#seek|seek()}, etc).
|
|
7739
|
+
* Limitations: Plugins are disabled and the method. Encryption
|
|
7740
|
+
* is supported only if all the items are encrypted with the same method
|
|
7741
|
+
* and key.
|
|
7742
|
+
*/
|
|
7743
|
+
export class ScPlaylist {
|
|
7744
|
+
/**
|
|
7745
|
+
* The single-controller playlist is intended for smooth continuous
|
|
7746
|
+
* back-to-back playback of multiple items. The playlist class inherits from
|
|
7747
|
+
* {@link clpp.Player} so all methods defined there can also be called on
|
|
7748
|
+
* the playlist instance (e.g. {@link clpp.Player#on|on()},
|
|
7749
|
+
* {@link clpp.Player#off|off()}, {@link clpp.Player#getPosition|getPosition()},
|
|
7750
|
+
* {@link clpp.Player#seek|seek()}, etc).
|
|
7751
|
+
* Limitations: Plugins are disabled and the method. Encryption
|
|
7752
|
+
* is supported only if all the items are encrypted with the same method
|
|
7753
|
+
* and key.
|
|
7754
|
+
*
|
|
7755
|
+
* @param element The media element or the ID
|
|
7756
|
+
* of the media element to use as the underlying player
|
|
7757
|
+
* @param opt_configuration The global
|
|
7758
|
+
* player configuration
|
|
7759
|
+
* @param opt_viewConfiguration The global player view configuration
|
|
7760
|
+
*/
|
|
7761
|
+
constructor(element: HTMLMediaElement|string, opt_configuration?: clpp.PlayerConfiguration, opt_viewConfiguration?: clpp.PlayerSurfaceConfiguration);
|
|
7762
|
+
/**
|
|
7763
|
+
* Append an item to the end of the playlist.
|
|
7764
|
+
* This method cannot be called before
|
|
7765
|
+
* {@link clpp.plist.ScPlaylist#open|open()}.
|
|
7766
|
+
*
|
|
7767
|
+
* @param config an item which must contain
|
|
7768
|
+
* at least an `id` and a `source`.
|
|
7769
|
+
*
|
|
7770
|
+
* @example // Append an item to the playlist.
|
|
7771
|
+
*
|
|
7772
|
+
* await playlist.addItem({
|
|
7773
|
+
* id: 'ASSET3',
|
|
7774
|
+
* source: { url: '...' }
|
|
7775
|
+
* });
|
|
7776
|
+
*/
|
|
7777
|
+
addItem(config: clpp.PlayerConfiguration): Promise<void>;
|
|
7778
|
+
/**
|
|
7779
|
+
* Destroy this playlist instance.
|
|
7780
|
+
* The instance will not be usable after it was destroyed.
|
|
7781
|
+
*
|
|
7782
|
+
* @example // Destroy the playlist.
|
|
7783
|
+
*
|
|
7784
|
+
* await playlist.destroy();
|
|
7785
|
+
* // Do not call any methods on the playlist after this point
|
|
7786
|
+
*/
|
|
7787
|
+
destroy(): Promise<void>;
|
|
7788
|
+
/**
|
|
7789
|
+
* Get the currently playing item.
|
|
7790
|
+
*
|
|
7791
|
+
* @example // Get the config of the current item.
|
|
7792
|
+
*
|
|
7793
|
+
* const item = playlist.getCurrentItem(); // { id: 'ASSET1', ... }
|
|
7794
|
+
*/
|
|
7795
|
+
getCurrentItem(): clpp.PlayerConfiguration|null;
|
|
7796
|
+
/**
|
|
7797
|
+
* Get the index of the currently playing item.
|
|
7798
|
+
*
|
|
7799
|
+
* @example // Get the index of the current item.
|
|
7800
|
+
*
|
|
7801
|
+
* const index = playlist.getCurrentItemIndex(); // 0
|
|
7802
|
+
*/
|
|
7803
|
+
getCurrentItemIndex(): number;
|
|
7804
|
+
/**
|
|
7805
|
+
* Get all the items of the playlist.
|
|
7806
|
+
*
|
|
7807
|
+
* @example // Get playlist items.
|
|
7808
|
+
*
|
|
7809
|
+
* const items = playlist.getPlaylist(); // [...]
|
|
7810
|
+
*/
|
|
7811
|
+
getPlaylist(): Array<clpp.PlayerConfiguration>;
|
|
7812
|
+
/**
|
|
7813
|
+
* Get the number of items in the playlist.
|
|
7814
|
+
*
|
|
7815
|
+
* @example // Get the number of items in the playlist.
|
|
7816
|
+
*
|
|
7817
|
+
* const countItems = playlist.getSize(); // 4
|
|
7818
|
+
*/
|
|
7819
|
+
getSize(): number;
|
|
7820
|
+
/**
|
|
7821
|
+
* Get the timeline of the playlist.
|
|
7822
|
+
*
|
|
7823
|
+
* @example // Get timeline windows.
|
|
7824
|
+
*
|
|
7825
|
+
* const timeline = playlist.getTimeline();
|
|
7826
|
+
* const windows = timeline?.getWindows();
|
|
7827
|
+
*
|
|
7828
|
+
* @example // Get the current timeline window.
|
|
7829
|
+
*
|
|
7830
|
+
* const timeline = playlist.getTimeline();
|
|
7831
|
+
* const timelineWindow = timeline?.getCurrentWindow();
|
|
7832
|
+
*/
|
|
7833
|
+
getTimeline(): clpp.media.Timeline|null;
|
|
7834
|
+
/**
|
|
7835
|
+
* Load items to the playlist and start playing the first one.
|
|
7836
|
+
*
|
|
7837
|
+
* @param index the index of the item to start playback at.
|
|
7838
|
+
* Currently only 0 is supported.
|
|
7839
|
+
* @param configs a list of items
|
|
7840
|
+
* where each config must contain at least an `id` and a `source`.
|
|
7841
|
+
*
|
|
7842
|
+
* @example // Open a playlist of two items, start from the position of 2 minutes and automatically start playback.
|
|
7843
|
+
*
|
|
7844
|
+
* await playlist.open(0, [
|
|
7845
|
+
* {
|
|
7846
|
+
* id: 'ASSET1',
|
|
7847
|
+
* source: { url: '...' },
|
|
7848
|
+
* autoplay: true,
|
|
7849
|
+
* playlist: {
|
|
7850
|
+
* startTime: 120,
|
|
7851
|
+
* }
|
|
7852
|
+
* },
|
|
7853
|
+
* {
|
|
7854
|
+
* id: 'ASSET2',
|
|
7855
|
+
* source: { url: '...' }
|
|
7856
|
+
* }
|
|
7857
|
+
* ]);
|
|
7858
|
+
*/
|
|
7859
|
+
open(index: number, configs: Array<clpp.PlayerConfiguration>): Promise<void>;
|
|
7860
|
+
/**
|
|
7861
|
+
* Release the playlist instance resources.
|
|
7862
|
+
* The playlist can load another source after it was released.
|
|
7863
|
+
*
|
|
7864
|
+
* @example // Release and reset the playlist.
|
|
7865
|
+
*
|
|
7866
|
+
* await playlist.release();
|
|
7867
|
+
*/
|
|
7868
|
+
release(): Promise<void>;
|
|
7869
|
+
/**
|
|
7870
|
+
* Seek to a position relative to the current position.
|
|
7871
|
+
* This may result in seeking to one of the following/preceding items
|
|
7872
|
+
* in the playlist.
|
|
7873
|
+
*
|
|
7874
|
+
* @param offset the offset in seconds relative to the current
|
|
7875
|
+
* position to seek by. A positive value seeks forward, a negative value
|
|
7876
|
+
* seeks backward.
|
|
7877
|
+
*
|
|
7878
|
+
* @example // Seek 2 minutes forward.
|
|
7879
|
+
*
|
|
7880
|
+
* await playlist.seekWith(120);
|
|
7881
|
+
*
|
|
7882
|
+
* @example // Seek 2 minutes backward.
|
|
7883
|
+
*
|
|
7884
|
+
* await playlist.seekWith(-120);
|
|
7885
|
+
*/
|
|
7886
|
+
seekWith(offset: number): Promise<void>;
|
|
7887
|
+
setCdnErrorCallback(): void;
|
|
7888
|
+
}
|
|
7553
7889
|
}
|
|
7554
7890
|
|
|
7555
7891
|
namespace smooth {
|
|
@@ -8225,8 +8561,8 @@ export namespace clpp {
|
|
|
8225
8561
|
* alternate encoding/alphabet also known as "base64url".
|
|
8226
8562
|
*
|
|
8227
8563
|
* @param data
|
|
8228
|
-
* @param opt_padding If true, pad the output with equals
|
|
8229
|
-
* Defaults to true.
|
|
8564
|
+
* @param opt_padding If true, pad the output with equals
|
|
8565
|
+
* signs. Defaults to true.
|
|
8230
8566
|
*/
|
|
8231
8567
|
static toBase64Url(data: BufferSource, opt_padding?: boolean): string;
|
|
8232
8568
|
/**
|