@castlabs/prestoplay 6.14.0 → 6.15.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +113 -111
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +550 -529
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +74 -73
  10. package/cjs/cl.externs.js +191 -64
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +69 -68
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -30
  15. package/cjs/cl.ima.js +23 -23
  16. package/cjs/cl.mse.js +290 -275
  17. package/cjs/cl.muxdata.js +15 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +13 -13
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.simid.js +15 -15
  22. package/cjs/cl.smooth.js +72 -71
  23. package/cjs/cl.thumbnails.js +26 -26
  24. package/cjs/cl.tizen.js +70 -70
  25. package/cjs/cl.ttml.js +28 -28
  26. package/cjs/cl.verimatrix.js +5 -5
  27. package/cjs/cl.vimond.js +13 -13
  28. package/cjs/cl.vr.js +19 -19
  29. package/cjs/cl.vtt.js +14 -14
  30. package/cjs/cl.youbora.js +20 -20
  31. package/cl.adobe.js +3 -3
  32. package/cl.airplay.js +3 -3
  33. package/cl.broadpeak.js +5 -5
  34. package/cl.cast.js +89 -88
  35. package/cl.conviva.js +27 -27
  36. package/cl.core.js +457 -438
  37. package/cl.crypto.js +9 -9
  38. package/cl.dash.js +70 -68
  39. package/cl.externs.js +187 -64
  40. package/cl.freewheel.js +19 -19
  41. package/cl.hls.js +71 -69
  42. package/cl.hlssmpte.js +5 -5
  43. package/cl.htmlcue.js +26 -26
  44. package/cl.ima.js +17 -17
  45. package/cl.mse.js +255 -240
  46. package/cl.muxdata.js +13 -13
  47. package/cl.onboard.js +4 -4
  48. package/cl.persistent.js +11 -11
  49. package/cl.playlist.js +5 -5
  50. package/cl.simid.js +13 -13
  51. package/cl.smooth.js +59 -59
  52. package/cl.thumbnails.js +19 -19
  53. package/cl.tizen.js +57 -57
  54. package/cl.ttml.js +22 -22
  55. package/cl.verimatrix.js +4 -4
  56. package/cl.vimond.js +8 -8
  57. package/cl.vr.js +15 -15
  58. package/cl.vtt.js +12 -12
  59. package/cl.youbora.js +15 -15
  60. package/clpp.styles.css +2 -0
  61. package/package.json +1 -1
  62. package/typings.d.ts +387 -90
package/typings.d.ts CHANGED
@@ -1161,6 +1161,13 @@ export namespace clpp {
1161
1161
  * HtmlCue component configuration.
1162
1162
  */
1163
1163
  htmlcue?: Partial<clpp.HtmlCueConfiguration>;
1164
+ /**
1165
+ * A unique identifier of this configuration object.
1166
+ * This attribute is optional, except for configuration objects passed to
1167
+ * {@link clpp.plist.ScPlaylist} for which the ID is mandatory, since we
1168
+ * need a clear way to distinguish different items of the playlist.
1169
+ */
1170
+ id?: string;
1164
1171
  /**
1165
1172
  * Ads plugin configuration.
1166
1173
  */
@@ -1204,6 +1211,10 @@ export namespace clpp {
1204
1211
  * back into foreground.
1205
1212
  */
1206
1213
  pauseWhenInBackground?: boolean;
1214
+ /**
1215
+ * Playlist-related configuration.
1216
+ */
1217
+ playlist?: Partial<clpp.PlaylistConfiguration>;
1207
1218
  /**
1208
1219
  * Defaults to `false`.
1209
1220
  *
@@ -1290,8 +1301,7 @@ export namespace clpp {
1290
1301
  */
1291
1302
  safari?: Partial<clpp.SafariConfiguration>;
1292
1303
  /**
1293
- * SIMID plugin
1294
- * configuration
1304
+ * SIMID plugin configuration
1295
1305
  */
1296
1306
  simid?: Partial<clpp.SimidConfiguration>;
1297
1307
  /**
@@ -1391,6 +1401,49 @@ export namespace clpp {
1391
1401
  webOSStartupPatch: boolean;
1392
1402
  }
1393
1403
 
1404
+ /**
1405
+ * Playlist-related configuration.
1406
+ */
1407
+ export type PlaylistConfiguration = {
1408
+ /**
1409
+ * Defaults to "VOD".
1410
+ *
1411
+ * This option applies to the single-controller playlist and the accepted
1412
+ * values are "VOD" and "DVR". In "VOD" mode the playlist can contain
1413
+ * VOD items only. In "DVR" mode the playlist can contain VOD items and
1414
+ * one DVR item at the end of the playlist.
1415
+ */
1416
+ content?: string;
1417
+ /**
1418
+ * Defaults to false.
1419
+ *
1420
+ * This option applies to the single-controller playlist. If true, the
1421
+ * timeline will be cropped based on the values of `startTime` and `endTime`.
1422
+ */
1423
+ cropTimeline?: boolean;
1424
+ /**
1425
+ * This option applies to the single-controller playlist. It is the time
1426
+ * at which the playlist should stop. The time is relative to the
1427
+ * start of the first playlist item and may span several items.
1428
+ */
1429
+ endTime?: number;
1430
+ /**
1431
+ * This option applies to the single-controller playlist. IT is the time
1432
+ * within the first playlist item at which the playlist should start
1433
+ * playback. The time is relative to the start of the first playlist item.
1434
+ */
1435
+ startTime?: number;
1436
+ /**
1437
+ * Defaults to "basic".
1438
+ *
1439
+ * This option applies to the single-controller playlist and the accepted
1440
+ * values are "basic" and "flat". In "basic" mode each item has its own
1441
+ * timeline, in "flat" mode all items of the playlist are concatenated into
1442
+ * a single timeline.
1443
+ */
1444
+ timeline?: string;
1445
+ }
1446
+
1394
1447
  /**
1395
1448
  * Playlist item.
1396
1449
  */
@@ -2240,14 +2293,22 @@ export namespace clpp {
2240
2293
  * EventStream element. In HLS this is the EXT-X-DATERANGE tag.
2241
2294
  */
2242
2295
  export type TimelineCue = {
2296
+ /**
2297
+ * ID of the configuration object of the asset to which this cue belongs
2298
+ * if it is defined in {@link clpp.PlayerConfiguration}.
2299
+ */
2300
+ configurationId?: string;
2243
2301
  /**
2244
2302
  * The presentation time (in seconds) that the cue should end.
2303
+ * Allowed values follow the same rules as startTime. It is possible
2304
+ * for endTime and startTime to be equal, in which case the cue is
2305
+ * considered to be a discrete point on the timeline.
2245
2306
  */
2246
2307
  endTime: number;
2247
2308
  /**
2248
- * The XML element that defines the Event.
2309
+ * The XML element that defines the Event. Defined only for DASH.
2249
2310
  */
2250
- eventElement: Element;
2311
+ eventElement: Element|null;
2251
2312
  /**
2252
2313
  * Specifies an identifier for this instance of the cue.
2253
2314
  */
@@ -2258,6 +2319,11 @@ export namespace clpp {
2258
2319
  schemeIdUri: string;
2259
2320
  /**
2260
2321
  * The presentation time (in seconds) that the cue should start.
2322
+ * Specifically for VOD streams the startTime is relative to the start of
2323
+ * the stream, so the value is something between 0 and duration.
2324
+ * For live streams the startTime is absolute, so the value is something
2325
+ * between the start of the first period and the end of the last period
2326
+ * of the stream.
2261
2327
  */
2262
2328
  startTime: number;
2263
2329
  /**
@@ -3100,8 +3166,18 @@ export namespace clpp {
3100
3166
  TIMELINE_CUE_EXIT = "timeline-cue-exit",
3101
3167
  /**
3102
3168
  * Triggered when a MPD type has changed from dynamic to static.
3169
+ * Note: You can also listen to the {@link clpp.events.LIVE_TURNED_STATIC}
3170
+ * event instead.
3103
3171
  */
3104
3172
  MPD_TYPE_CHANGED = "mpd-type-changed",
3173
+ /**
3174
+ * Triggered when a live stream turned in to a static stream.
3175
+ * In HLS this happens when EXT-X-ENDLIST appears in the playlist
3176
+ * and the playlist stops updating. In DASH this happens when
3177
+ * the type attribute of MPD turns from "dynamic" to "static"
3178
+ * and the manifest stops updating.
3179
+ */
3180
+ LIVE_TURNED_STATIC = "live-turned-static",
3105
3181
  /**
3106
3182
  * Triggered when there is a response from Vimond Session API.
3107
3183
  */
@@ -3114,6 +3190,28 @@ export namespace clpp {
3114
3190
  * Triggered when a playlist item has been added, removed or moved.
3115
3191
  */
3116
3192
  PLAYLIST_MODIFIED = "playlist-modified",
3193
+ /**
3194
+ * Triggered when a new timeline window has been added to the timeline of
3195
+ * a single-controller playlist, or when the duration of an existing timeline
3196
+ * window changes.
3197
+ */
3198
+ SC_PLAYLIST_TIMELINE_CHANGED = "sc-playlist-timeline-changed",
3199
+ /**
3200
+ * Triggered when the currently active/selected item of a single-controller
3201
+ * playlist changes.
3202
+ */
3203
+ SC_PLAYLIST_ITEM_CHANGED = "sc-playlist-item-changed",
3204
+ /**
3205
+ * Triggered when playback reaches the end of the last item of
3206
+ * a single-controller playlist, or if `playlist.endTime` is configured
3207
+ * then it's triggered when the end time is reached.
3208
+ */
3209
+ SC_PLAYLIST_ENDED = "sc-playlist-ended",
3210
+ /**
3211
+ * Triggered when the last item of the playlist is an EVENT stream and it
3212
+ * turns from dynamic to static.
3213
+ */
3214
+ SC_PLAYLIST_LIVE_TURNED_STATIC = "sc-playlist-live-turned-static",
3117
3215
  /**
3118
3216
  * Triggered when CDN switch was successful.
3119
3217
  */
@@ -3401,11 +3499,11 @@ export namespace clpp {
3401
3499
  /**
3402
3500
  * Returns the player surface.
3403
3501
  */
3404
- getSurface(): clpp.IPlayerSurface|null;
3502
+ getSurface(): clpp.IPlayerSurface;
3405
3503
  /**
3406
3504
  * Get the text displayer.
3407
3505
  */
3408
- getTextDisplayer(): clpp.ITextDisplayer;
3506
+ getTextDisplayer(): clpp.ITextDisplayer|null;
3409
3507
  /**
3410
3508
  * Returns an array of timeline cues.
3411
3509
  */
@@ -3417,7 +3515,7 @@ export namespace clpp {
3417
3515
  */
3418
3516
  getTimelineOffset(): clpp.TimelineOffset|null;
3419
3517
  /**
3420
- * Returns track manager.
3518
+ * Returns the track manager.
3421
3519
  */
3422
3520
  getTrackManager(): clpp.TrackManager|null;
3423
3521
  /**
@@ -3426,7 +3524,7 @@ export namespace clpp {
3426
3524
  */
3427
3525
  getVolume(): number|null;
3428
3526
  /**
3429
- * Returns true if playback ended. False otherwise.
3527
+ * Returns true if playback ended, false otherwise.
3430
3528
  */
3431
3529
  isEnded(): boolean;
3432
3530
  /**
@@ -3437,21 +3535,19 @@ export namespace clpp {
3437
3535
  * On the Tizen platform the `http://tizen.org/privilege/tv.audio` privilege
3438
3536
  * is required.
3439
3537
  */
3440
- isMuted(): boolean|null;
3538
+ isMuted(): boolean;
3441
3539
  /**
3442
- * Returns true if playback is paused. False otherwise.
3540
+ * Returns true if playback is paused, false otherwise.
3443
3541
  */
3444
3542
  isPaused(): boolean;
3445
3543
  /**
3446
3544
  * Tell the player to load given content.
3447
- *
3448
3545
  * You may load content by passing a `string`, a {@link clpp.Source}, an array
3449
3546
  * of sources or player configuration. If multiple sources are passed to a
3450
3547
  * `load` method, player will play first source, that can be played on given
3451
3548
  * platform. Please refer to examples below for more details.
3452
- *
3453
- * If the player already playing another source, it will release itself first
3454
- * before loading the new source.
3549
+ * If the player is already playing another source, it will release itself
3550
+ * first before loading the new source.
3455
3551
  *
3456
3552
  * @example // Passing a string
3457
3553
  *
@@ -3658,13 +3754,6 @@ export namespace clpp {
3658
3754
  * });
3659
3755
  */
3660
3756
  setDrmCustomDataModifier(modifier: Function): void;
3661
- /**
3662
- * On the Tizen platform the `http://tizen.org/privilege/tv.audio` privilege
3663
- * is required.
3664
- *
3665
- * @param muted The muted state
3666
- */
3667
- setMuted(muted: boolean): void;
3668
3757
  /**
3669
3758
  * Set the network engine.
3670
3759
  *
@@ -4554,7 +4643,7 @@ export namespace clpp {
4554
4643
  */
4555
4644
  CONTENT_UNSUPPORTED_BY_BROWSER = 4032,
4556
4645
  /**
4557
- * Microsoft smooth streaming invalid manifest XML
4646
+ * Microsoft smooth streaming invalid manifest XML.
4558
4647
  * The {@link clpp.Error#data} property contains an object with the following
4559
4648
  * properties:
4560
4649
  *
@@ -4581,7 +4670,7 @@ export namespace clpp {
4581
4670
  */
4582
4671
  SMOOTH_MEDIA_PROCESSING_ERROR = 4035,
4583
4672
  /**
4584
- * The smooth streaming manifest version is invalid
4673
+ * The smooth streaming manifest version is invalid.
4585
4674
  * The {@link clpp.Error#data} property contains an object with the following
4586
4675
  * properties:
4587
4676
  *
@@ -4845,16 +4934,31 @@ export namespace clpp {
4845
4934
  */
4846
4935
  INVALID_CONTAINER_ELEMENT = 7006,
4847
4936
  /**
4848
- * The provided {@link clpp.PlayerConfiguration} is invalid
4937
+ * Error raised when a method is passed an invalid argument.
4938
+ */
4939
+ INVALID_ARGUMENT = 7007,
4940
+ /**
4941
+ * Error raised when two methods which depend on each other are called
4942
+ * in the wrong order.
4943
+ */
4944
+ WRONG_ORDER_OF_OPERATIONS = 7008,
4945
+ /**
4946
+ * Error raised when calling a method which is not supported or passing
4947
+ * arguments or a configuration of arguments that are not supported. This
4948
+ * may also be platform dependent.
4949
+ */
4950
+ NOT_SUPPORTED = 7009,
4951
+ /**
4952
+ * The provided {@link clpp.PlayerConfiguration} is invalid.
4849
4953
  */
4850
4954
  INVALID_CONFIGURATION = 7100,
4851
4955
  /**
4852
4956
  * The provided {@link clpp.PlayerConfiguration#license} does not exist
4853
- * or is invalid
4957
+ * or is invalid.
4854
4958
  */
4855
4959
  INVALID_LICENSE = 7101,
4856
4960
  /**
4857
- * No DOM element or element ID was provided when initializing the player
4961
+ * No DOM element or element ID was provided when initializing the player.
4858
4962
  */
4859
4963
  NO_ELEMENT = 7102,
4860
4964
  /**
@@ -4933,7 +5037,7 @@ export namespace clpp {
4933
5037
  */
4934
5038
  GL_CONTEXT_ERROR = 9003,
4935
5039
  /**
4936
- * Error code that indicates that the player not able to compile a shader
5040
+ * Error code that indicates that the player not able to compile a shader.
4937
5041
  */
4938
5042
  GL_SHADER_ERROR = 9004,
4939
5043
  /**
@@ -4989,7 +5093,7 @@ export namespace clpp {
4989
5093
  */
4990
5094
  AD_ERROR = 10003,
4991
5095
  /**
4992
- * Triggered when no container could be found to add a SIMID creative
5096
+ * Triggered when no container could be found to add a SIMID creative.
4993
5097
  */
4994
5098
  SIMID_CONTAINER_MISSING = 10100,
4995
5099
  /**
@@ -6241,9 +6345,8 @@ export namespace clpp {
6241
6345
  */
6242
6346
  append(cues: Array<clpp.text.Cue>, styles: Array<string>): void;
6243
6347
  /**
6244
- * Request that this object be destroyed, releasing all resources.
6245
- * It also shuts down all active operations.
6246
- * Returns a Promise which is resolved when destruction
6348
+ * Request that this object be destroyed, releasing all resources and shutting
6349
+ * down all operations. Returns a Promise which is resolved when destruction
6247
6350
  * is complete. This Promise should never be rejected.
6248
6351
  */
6249
6352
  destroy(): Promise<void>;
@@ -6428,60 +6531,8 @@ export namespace clpp {
6428
6531
  */
6429
6532
  export class Player {
6430
6533
  /**
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
- /**
6482
- * Request that this object be destroyed, releasing all resources.
6483
- * It also shuts down all active operations.
6484
- * Returns a Promise which is resolved when destruction
6534
+ * Request that this object be destroyed, releasing all resources and shutting
6535
+ * down all operations. Returns a Promise which is resolved when destruction
6485
6536
  * is complete. This Promise should never be rejected.
6486
6537
  */
6487
6538
  destroy(): Promise<void>;
@@ -6710,6 +6761,86 @@ export namespace clpp {
6710
6761
  }
6711
6762
  }
6712
6763
 
6764
+ namespace media {
6765
+ export class Timeline {
6766
+ /**
6767
+ * Get the currently active window of the timeline.
6768
+ *
6769
+ * @example // Get the current timeline window.
6770
+ *
6771
+ * const timelineWindow = timeline.getCurrentWindow();
6772
+ */
6773
+ getCurrentWindow(): clpp.media.TimelineWindow|null;
6774
+ /**
6775
+ * Get the index of the currently active window of the timeline.
6776
+ *
6777
+ * @example // Get the index of the current timeline window.
6778
+ *
6779
+ * const index = timeline.getCurrentWindowIndex(); // 0
6780
+ */
6781
+ getCurrentWindowIndex(): number;
6782
+ /**
6783
+ * Get a window of the timeline at the given index.
6784
+ *
6785
+ * @example // Get timeline window at index.
6786
+ *
6787
+ * const timelineWindow = timeline.getWindow(0);
6788
+ */
6789
+ getWindow(index: number): clpp.media.TimelineWindow|null;
6790
+ /**
6791
+ * Get the number of windows in the timeline.
6792
+ *
6793
+ * @example // Get the number of timeline windows.
6794
+ *
6795
+ * const count = timeline.getWindowCount(); // 4
6796
+ */
6797
+ getWindowCount(): number;
6798
+ /**
6799
+ * Get all the windows of the timeline.
6800
+ *
6801
+ * @example // Get all timeline windows.
6802
+ *
6803
+ * const windows = timeline.getWindows(); // [...]
6804
+ */
6805
+ getWindows(): Array<clpp.media.TimelineWindow>;
6806
+ }
6807
+
6808
+ export class TimelineWindow {
6809
+ /**
6810
+ * Get the duration of the timeline window.
6811
+ *
6812
+ * @example // Get the duration.
6813
+ *
6814
+ * const duration = timelineWindow.getDuration(); // 600
6815
+ */
6816
+ getDuration(): number;
6817
+ /**
6818
+ * Get the ID of the timeline window.
6819
+ *
6820
+ * @example // Get the ID.
6821
+ *
6822
+ * const id = timelineWindow.getId(); // "asset1"
6823
+ */
6824
+ getId(): string;
6825
+ /**
6826
+ * Get the start time of the timeline window.
6827
+ *
6828
+ * @example // Get the start of the window.
6829
+ *
6830
+ * const startTime = timelineWindow.getStart(); // 400
6831
+ */
6832
+ getStart(): number;
6833
+ /**
6834
+ * Check whether the timeline window is static or dynamic.
6835
+ *
6836
+ * @example // Check if the window is dynamic.
6837
+ *
6838
+ * const dynamic = timelineWindow.isDynamic(); // false
6839
+ */
6840
+ isDynamic(): boolean;
6841
+ }
6842
+ }
6843
+
6713
6844
  namespace muxdata {
6714
6845
  export class MuxDataPlugin {
6715
6846
  static Id: string;
@@ -7417,6 +7548,15 @@ export namespace clpp {
7417
7548
  * for video elements created by this playlist.
7418
7549
  */
7419
7550
  anchorId: string;
7551
+ /**
7552
+ * If true, when one item finishes playback the next item is played
7553
+ * automatically and so on until the end of the playlist.
7554
+ */
7555
+ autoplayNext?: boolean;
7556
+ /**
7557
+ * Default configuration for player instances.
7558
+ */
7559
+ config: clpp.PlayerConfiguration;
7420
7560
  /**
7421
7561
  * If true, preloaded items will have also their media segments preloaded
7422
7562
  * thus reducing the time to start playback to minimum. This option is
@@ -7477,9 +7617,8 @@ export namespace clpp {
7477
7617
  */
7478
7618
  constructor(options: clpp.plist.Options);
7479
7619
  /**
7480
- * Request that this object be destroyed, releasing all resources.
7481
- * It also shuts down all active operations.
7482
- * Returns a Promise which is resolved when destruction
7620
+ * Request that this object be destroyed, releasing all resources and shutting
7621
+ * down all operations. Returns a Promise which is resolved when destruction
7483
7622
  * is complete. This Promise should never be rejected.
7484
7623
  */
7485
7624
  destroy(): Promise<void>;
@@ -7543,6 +7682,164 @@ export namespace clpp {
7543
7682
  */
7544
7683
  setItems(configs: Array<clpp.PlayerConfiguration>): void;
7545
7684
  }
7685
+
7686
+ /**
7687
+ * The single-controller playlist is intended for smooth continuous
7688
+ * back-to-back playback of multiple items. The playlist class inherits from
7689
+ * {@link clpp.Player} so all methods defined there can also be called on
7690
+ * the playlist instance (e.g. {@link clpp.Player#on|on()},
7691
+ * {@link clpp.Player#off|off()}, {@link clpp.Player#getPosition|getPosition()},
7692
+ * {@link clpp.Player#seek|seek()}, etc).
7693
+ * Limitations: Plugins are disabled and the method. Encryption
7694
+ * is supported only if all the items are encrypted with the same method
7695
+ * and key.
7696
+ */
7697
+ export class ScPlaylist {
7698
+ /**
7699
+ * The single-controller playlist is intended for smooth continuous
7700
+ * back-to-back playback of multiple items. The playlist class inherits from
7701
+ * {@link clpp.Player} so all methods defined there can also be called on
7702
+ * the playlist instance (e.g. {@link clpp.Player#on|on()},
7703
+ * {@link clpp.Player#off|off()}, {@link clpp.Player#getPosition|getPosition()},
7704
+ * {@link clpp.Player#seek|seek()}, etc).
7705
+ * Limitations: Plugins are disabled and the method. Encryption
7706
+ * is supported only if all the items are encrypted with the same method
7707
+ * and key.
7708
+ *
7709
+ * @param element The media element or the ID
7710
+ * of the media element to use as the underlying player
7711
+ * @param opt_configuration The global
7712
+ * player configuration
7713
+ * @param opt_viewConfiguration The global player view configuration
7714
+ */
7715
+ constructor(element: HTMLMediaElement|string, opt_configuration?: clpp.PlayerConfiguration, opt_viewConfiguration?: clpp.PlayerSurfaceConfiguration);
7716
+ /**
7717
+ * Append an item to the end of the playlist.
7718
+ * This method cannot be called before
7719
+ * {@link clpp.plist.ScPlaylist#open|open()}.
7720
+ *
7721
+ * @param config an item which must contain
7722
+ * at least an `id` and a `source`.
7723
+ *
7724
+ * @example // Append an item to the playlist.
7725
+ *
7726
+ * await playlist.addItem({
7727
+ * id: 'ASSET3',
7728
+ * source: { url: '...' }
7729
+ * });
7730
+ */
7731
+ addItem(config: clpp.PlayerConfiguration): Promise<void>;
7732
+ /**
7733
+ * Destroy this playlist instance.
7734
+ * The instance will not be usable after it was destroyed.
7735
+ *
7736
+ * @example // Destroy the playlist.
7737
+ *
7738
+ * await playlist.destroy();
7739
+ * // Do not call any methods on the playlist after this point
7740
+ */
7741
+ destroy(): Promise<void>;
7742
+ /**
7743
+ * Get the currently playing item.
7744
+ *
7745
+ * @example // Get the config of the current item.
7746
+ *
7747
+ * const item = playlist.getCurrentItem(); // { id: 'ASSET1', ... }
7748
+ */
7749
+ getCurrentItem(): clpp.PlayerConfiguration|null;
7750
+ /**
7751
+ * Get the index of the currently playing item.
7752
+ *
7753
+ * @example // Get the index of the current item.
7754
+ *
7755
+ * const index = playlist.getCurrentItemIndex(); // 0
7756
+ */
7757
+ getCurrentItemIndex(): number;
7758
+ /**
7759
+ * Get all the items of the playlist.
7760
+ *
7761
+ * @example // Get playlist items.
7762
+ *
7763
+ * const items = playlist.getPlaylist(); // [...]
7764
+ */
7765
+ getPlaylist(): Array<clpp.PlayerConfiguration>;
7766
+ /**
7767
+ * Get the number of items in the playlist.
7768
+ *
7769
+ * @example // Get the number of items in the playlist.
7770
+ *
7771
+ * const countItems = playlist.getSize(); // 4
7772
+ */
7773
+ getSize(): number;
7774
+ /**
7775
+ * Get the timeline of the playlist.
7776
+ *
7777
+ * @example // Get timeline windows.
7778
+ *
7779
+ * const timeline = playlist.getTimeline();
7780
+ * const windows = timeline?.getWindows();
7781
+ *
7782
+ * @example // Get the current timeline window.
7783
+ *
7784
+ * const timeline = playlist.getTimeline();
7785
+ * const timelineWindow = timeline?.getCurrentWindow();
7786
+ */
7787
+ getTimeline(): clpp.media.Timeline|null;
7788
+ /**
7789
+ * Load items to the playlist and start playing the first one.
7790
+ *
7791
+ * @param index the index of the item to start playback at.
7792
+ * Currently only 0 is supported.
7793
+ * @param configs a list of items
7794
+ * where each config must contain at least an `id` and a `source`.
7795
+ *
7796
+ * @example // Open a playlist of two items, start from the position of 2 minutes and automatically start playback.
7797
+ *
7798
+ * await playlist.open(0, [
7799
+ * {
7800
+ * id: 'ASSET1',
7801
+ * source: { url: '...' },
7802
+ * autoplay: true,
7803
+ * playlist: {
7804
+ * startTime: 120,
7805
+ * }
7806
+ * },
7807
+ * {
7808
+ * id: 'ASSET2',
7809
+ * source: { url: '...' }
7810
+ * }
7811
+ * ]);
7812
+ */
7813
+ open(index: number, configs: Array<clpp.PlayerConfiguration>): Promise<void>;
7814
+ /**
7815
+ * Release the playlist instance resources.
7816
+ * The playlist can load another source after it was released.
7817
+ *
7818
+ * @example // Release and reset the playlist.
7819
+ *
7820
+ * await playlist.release();
7821
+ */
7822
+ release(): Promise<void>;
7823
+ /**
7824
+ * Seek to a position relative to the current position.
7825
+ * This may result in seeking to one of the following/preceding items
7826
+ * in the playlist.
7827
+ *
7828
+ * @param offset the offset in seconds relative to the current
7829
+ * position to seek by. A positive value seeks forward, a negative value
7830
+ * seeks backward.
7831
+ *
7832
+ * @example // Seek 2 minutes forward.
7833
+ *
7834
+ * await playlist.seekWith(120);
7835
+ *
7836
+ * @example // Seek 2 minutes backward.
7837
+ *
7838
+ * await playlist.seekWith(-120);
7839
+ */
7840
+ seekWith(offset: number): Promise<void>;
7841
+ setCdnErrorCallback(): void;
7842
+ }
7546
7843
  }
7547
7844
 
7548
7845
  namespace smooth {
@@ -8218,8 +8515,8 @@ export namespace clpp {
8218
8515
  * alternate encoding/alphabet also known as "base64url".
8219
8516
  *
8220
8517
  * @param data
8221
- * @param opt_padding If true, pad the output with equals signs.
8222
- * Defaults to true.
8518
+ * @param opt_padding If true, pad the output with equals
8519
+ * signs. Defaults to true.
8223
8520
  */
8224
8521
  static toBase64Url(data: BufferSource, opt_padding?: boolean): string;
8225
8522
  /**