@castlabs/prestoplay 6.28.0 → 6.30.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 (66) hide show
  1. package/CHANGELOG.md +37 -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 +128 -116
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +619 -614
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +92 -89
  10. package/cjs/cl.externs.js +154 -60
  11. package/cjs/cl.freewheel.js +25 -25
  12. package/cjs/cl.hls.js +77 -77
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +25 -23
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +350 -349
  18. package/cjs/cl.muxdata.js +14 -14
  19. package/cjs/cl.onboard.js +4 -4
  20. package/cjs/cl.persistent.js +15 -15
  21. package/cjs/cl.playlist.js +6 -6
  22. package/cjs/cl.simid.js +16 -16
  23. package/cjs/cl.smooth.js +57 -58
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +60 -60
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -12
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +4 -4
  32. package/cjs/cl.youbora.js +38 -38
  33. package/cjs/polyfill.min.js +2 -2
  34. package/cl.adobe.js +3 -3
  35. package/cl.airplay.js +3 -3
  36. package/cl.broadpeak.js +6 -6
  37. package/cl.cast.js +101 -92
  38. package/cl.conviva.js +27 -27
  39. package/cl.core.js +500 -496
  40. package/cl.crypto.js +9 -9
  41. package/cl.dash.js +84 -83
  42. package/cl.externs.js +150 -60
  43. package/cl.freewheel.js +19 -19
  44. package/cl.hls.js +82 -80
  45. package/cl.hlssmpte.js +5 -5
  46. package/cl.htmlcue.js +26 -26
  47. package/cl.ima.js +19 -17
  48. package/cl.mediatailor.js +2 -2
  49. package/cl.mse.js +304 -305
  50. package/cl.muxdata.js +13 -13
  51. package/cl.onboard.js +4 -4
  52. package/cl.persistent.js +11 -11
  53. package/cl.playlist.js +5 -5
  54. package/cl.simid.js +14 -14
  55. package/cl.smooth.js +60 -60
  56. package/cl.thumbnails.js +19 -19
  57. package/cl.tizen.js +56 -56
  58. package/cl.ttml.js +22 -22
  59. package/cl.verimatrix.js +4 -4
  60. package/cl.vimond.js +8 -8
  61. package/cl.vr.js +14 -14
  62. package/cl.vtt.js +12 -12
  63. package/cl.yospace.js +3 -3
  64. package/cl.youbora.js +31 -31
  65. package/package.json +1 -1
  66. package/typings.d.ts +198 -88
package/typings.d.ts CHANGED
@@ -875,6 +875,11 @@ export namespace clpp {
875
875
  * Enables preloading of video assets.
876
876
  */
877
877
  enablePreloading: boolean;
878
+ /**
879
+ * Set to true when using custom playback on SmartTV and iOS to enforce
880
+ * VAST playback (required to play plain VAST without VMAP).
881
+ */
882
+ isVast?: boolean;
878
883
  /**
879
884
  * Timeout (in milliseconds) when loading a video ad media file.
880
885
  * Use -1 for the default of 8 seconds.
@@ -1347,7 +1352,7 @@ export namespace clpp {
1347
1352
  /**
1348
1353
  * A unique identifier of this configuration object.
1349
1354
  * This attribute is optional, except for configuration objects passed to
1350
- * {@link clpp.plist.ScPlaylist} for which the ID is mandatory, since we
1355
+ * {@link clpp.playlist.ScPlaylist} for which the ID is mandatory, since we
1351
1356
  * need a clear way to distinguish different items of the playlist.
1352
1357
  */
1353
1358
  id?: string;
@@ -1646,6 +1651,11 @@ export namespace clpp {
1646
1651
  * Optional. The URL of the poster.
1647
1652
  */
1648
1653
  image?: string;
1654
+ /**
1655
+ * Optional. If false, the item cannot be skipped via playlist controls. This
1656
+ * property is respected only in {@link clpp.cast.playlist.CastPlaylist}.
1657
+ */
1658
+ skippable?: boolean;
1649
1659
  /**
1650
1660
  * Optional. The title.
1651
1661
  */
@@ -3301,7 +3311,7 @@ export namespace clpp {
3301
3311
  */
3302
3312
  DRM_LICENSE_REQUESTED = "drmlicenserequested",
3303
3313
  /**
3304
- * Triggered when an attempt to autoplay the media was block by the platform.
3314
+ * Triggered when an attempt to autoplay the media was blocked by the platform.
3305
3315
  */
3306
3316
  AUTOPLAY_NOT_ALLOWED = "autoplaynotallowed",
3307
3317
  /**
@@ -3429,6 +3439,11 @@ export namespace clpp {
3429
3439
  * Triggered when status of cast receiver changed.
3430
3440
  */
3431
3441
  CAST_STATUS_CHANGED = "caststatuschanged",
3442
+ /**
3443
+ * Triggered when the cast receiver app goes into the background, or from
3444
+ * background back to foreground.
3445
+ */
3446
+ CAST_VISIBILITY_CHANGED = "castvisibilitychanged",
3432
3447
  /**
3433
3448
  * Triggered when status of AirPlay availability changed.
3434
3449
  */
@@ -4323,7 +4338,7 @@ export namespace clpp {
4323
4338
  */
4324
4339
  start(): void;
4325
4340
  /**
4326
- * Stop iterating the playlist.
4341
+ * Stop iterating the playlist. Does not stop the playback.
4327
4342
  */
4328
4343
  stop(): void;
4329
4344
  }
@@ -4528,6 +4543,9 @@ export namespace clpp {
4528
4543
  }
4529
4544
 
4530
4545
  namespace Error {
4546
+ /**
4547
+ * Error category.
4548
+ */
4531
4549
  export enum Category {
4532
4550
  /**
4533
4551
  * Errors from the network stack.
@@ -4571,6 +4589,9 @@ export namespace clpp {
4571
4589
  ADS = 10,
4572
4590
  }
4573
4591
 
4592
+ /**
4593
+ * Error code.
4594
+ */
4574
4595
  export enum Code {
4575
4596
  /**
4576
4597
  * A network request was made using an unsupported URI scheme.
@@ -5031,8 +5052,7 @@ export namespace clpp {
5031
5052
  */
5032
5053
  CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM = 4040,
5033
5054
  /**
5034
- * We do not support playing Fairplay-encrypted transport streams
5035
- * (MPEG-TS) with MSE.
5055
+ * Due to limitations of the MSE API Fairplay-protected MPEG-TS is not supported.
5036
5056
  */
5037
5057
  HLS_MSE_ENCRYPTED_TS_NOT_SUPPORTED = 4041,
5038
5058
  /**
@@ -5453,6 +5473,9 @@ export namespace clpp {
5453
5473
  SESSIONS_INVALID_CONFIGURATION = 15000,
5454
5474
  }
5455
5475
 
5476
+ /**
5477
+ * Error severity.
5478
+ */
5456
5479
  export enum Severity {
5457
5480
  /**
5458
5481
  * An error occurred that the player will try to recover from. If retrying
@@ -5850,8 +5873,9 @@ export namespace clpp {
5850
5873
  * @param opt_playerConfig optional
5851
5874
  * configuration to cast. If omitted, player will try to cast current
5852
5875
  * content.
5876
+ * @param opt_queueOptions optional queue items and starting index to load.
5853
5877
  */
5854
- cast(opt_playerConfig?: clpp.PlayerConfiguration): Promise<void>;
5878
+ cast(opt_playerConfig?: clpp.PlayerConfiguration, opt_queueOptions?: Record<string, any>): Promise<void>;
5855
5879
  /**
5856
5880
  * Change receiver id. It will close current session, if any.
5857
5881
  *
@@ -6122,6 +6146,89 @@ export namespace clpp {
6122
6146
  updateContentMetadata(metadata: clpp.cast.utils.ReceiverMetadataObject|null): void;
6123
6147
  }
6124
6148
 
6149
+ namespace playlist {
6150
+ /**
6151
+ * Creates a playlist controller bound to the provided player.
6152
+ */
6153
+ export class CastPlaylist {
6154
+ /**
6155
+ * Creates a playlist controller bound to the provided player.
6156
+ *
6157
+ * @param player sender player instance
6158
+ * @param castAppId Chromecast receiver application ID
6159
+ * @param playlistItems items to enqueue
6160
+ */
6161
+ constructor(player: clpp.Player, castAppId: string, playlistItems: Array<clpp.PlaylistItem>);
6162
+ /**
6163
+ * Appends a new item locally and mirrors it to the cast queue when casting.
6164
+ */
6165
+ append(item: clpp.PlaylistItem): Promise<void>;
6166
+ /**
6167
+ * Returns whether casting is currently active.
6168
+ */
6169
+ canCast(): boolean;
6170
+ /**
6171
+ * Stops playlist, destroys the current underlying castProxy
6172
+ * and releases player.
6173
+ */
6174
+ destroy(): void;
6175
+ /**
6176
+ * Returns the index of the currently active playlist item.
6177
+ */
6178
+ getCurrentIndex(): number;
6179
+ /**
6180
+ * Returns the current local playlist queue.
6181
+ */
6182
+ getPlaylistItems(): Array<clpp.PlaylistItem>;
6183
+ /**
6184
+ * Returns whether casting is currently active.
6185
+ */
6186
+ isCasting(): boolean;
6187
+ /**
6188
+ * Moves to the next playlist item using cast queue when casting.
6189
+ */
6190
+ next(): Promise<void>;
6191
+ /**
6192
+ * Registers a handler for cast availability or connection status changes.
6193
+ *
6194
+ * @param handler callback invoked with event payload
6195
+ */
6196
+ onCastStatusChanged(handler: Function): clpp.EventCallback;
6197
+ /**
6198
+ * Registers a handler invoked when the active playlist index changes.
6199
+ *
6200
+ * @param handler callback invoked with event payload
6201
+ */
6202
+ onPlaylistItemChange(handler: Function): clpp.EventCallback;
6203
+ /**
6204
+ * Registers a handler invoked when the playlist content is modified.
6205
+ *
6206
+ * @param handler callback invoked with event payload
6207
+ */
6208
+ onPlaylistModified(handler: Function): clpp.EventCallback;
6209
+ /**
6210
+ * Pauses playback on the underlying player.
6211
+ */
6212
+ pause(): void;
6213
+ /**
6214
+ * Plays the underlying player.
6215
+ */
6216
+ play(): void;
6217
+ /**
6218
+ * Moves to the previous playlist item using cast queue when casting.
6219
+ */
6220
+ previous(): Promise<void>;
6221
+ /**
6222
+ * Starts playlist playback from the current index.
6223
+ */
6224
+ start(): void;
6225
+ /**
6226
+ * Starts casting with the current queue or disconnects if already casting.
6227
+ */
6228
+ toggleCast(): Promise<void>;
6229
+ }
6230
+ }
6231
+
6125
6232
  namespace utils {
6126
6233
  /**
6127
6234
  * Callback function used to modify load request data before play.
@@ -6974,7 +7081,7 @@ export namespace clpp {
6974
7081
  export type LogInterceptor = Function;
6975
7082
 
6976
7083
  /**
6977
- * All available log levels
7084
+ * Log level.
6978
7085
  */
6979
7086
  export enum Level {
6980
7087
  /**
@@ -7965,82 +8072,7 @@ export namespace clpp {
7965
8072
  }
7966
8073
  }
7967
8074
 
7968
- namespace plist {
7969
- /**
7970
- * A playlist item.
7971
- * It consists of an asset/config, a player instances selected
7972
- * to play this asset and the underlying video element to which the player is
7973
- * attached.
7974
- */
7975
- export type Item = {
7976
- /**
7977
- * Source configuration.
7978
- */
7979
- config: clpp.PlayerConfiguration;
7980
- /**
7981
- * The index of the item in the playlist.
7982
- */
7983
- index: number;
7984
- /**
7985
- * A player instance.
7986
- */
7987
- player: clpp.Player|null;
7988
- /**
7989
- * A promise that resolves when the item is preloaded.
7990
- */
7991
- preloadPromise: Promise<void>;
7992
- /**
7993
- * The role of the item.
7994
- */
7995
- role: string;
7996
- /**
7997
- * The state of the item (e.g. 'preloading', 'preloaded', 'preload-failed').
7998
- */
7999
- state: string;
8000
- /**
8001
- * The video element attached to the player.
8002
- */
8003
- videoEl: HTMLVideoElement|null;
8004
- }
8005
-
8006
- /**
8007
- * Playlist options.
8008
- */
8009
- export type Options = {
8010
- /**
8011
- * ID of the HTML element to be used as a container
8012
- * for video elements created by this playlist.
8013
- */
8014
- anchorId: string;
8015
- /**
8016
- * If true, when one item finishes playback the next item is played
8017
- * automatically and so on until the end of the playlist.
8018
- */
8019
- autoplayNext?: boolean;
8020
- /**
8021
- * Default configuration for player instances.
8022
- */
8023
- config: clpp.PlayerConfiguration;
8024
- /**
8025
- * If true, preloaded items will have also their media segments preloaded
8026
- * thus reducing the time to start playback to minimum. This option is
8027
- * intended to be used with VOD streams.
8028
- */
8029
- preloadMedia?: boolean;
8030
- /**
8031
- * A custom callback to toggle the visibility of a video element. By default
8032
- * this is done via z-index.
8033
- */
8034
- toggleVisible?: Function;
8035
- /**
8036
- * Transition method, can be "pause" or "keep-playing". In cause of "pause"
8037
- * the current video will be paused when calling
8038
- * {@link clpp.plist.McPlaylist.playNext} or
8039
- * {@link clpp.plist.McPlaylist.playPrev}.
8040
- */
8041
- transition?: string;
8042
- }
8043
-
8075
+ namespace playlist {
8044
8076
  /**
8045
8077
  * Multi-controller playlist intended for fast live TV channel zapping.
8046
8078
  * It is based on an architecture which leverages multiple video elements
@@ -8116,12 +8148,13 @@ export namespace clpp {
8116
8148
  hasPrev(): boolean;
8117
8149
  /**
8118
8150
  * Play the first item.
8119
- * Make sure to set items via {@link clpp.plist.McPlaylist.setItems} and
8120
- * select the index to start from via {@link clpp.plist.McPlaylist.setIndex}
8151
+ * Make sure to set items via {@link clpp.playlist.McPlaylist.setItems} and
8152
+ * select the index to start from via
8153
+ * {@link clpp.playlist.McPlaylist.setIndex}
8121
8154
  * before calling this method.
8122
8155
  * To switch to the next or previous item use methods
8123
- * {@link clpp.plist.McPlaylist.playNext} and
8124
- * {@link clpp.plist.McPlaylist.playPrev}.
8156
+ * {@link clpp.playlist.McPlaylist.playNext} and
8157
+ * {@link clpp.playlist.McPlaylist.playPrev}.
8125
8158
  */
8126
8159
  playFirst(): Promise<void>;
8127
8160
  /**
@@ -8180,7 +8213,7 @@ export namespace clpp {
8180
8213
  /**
8181
8214
  * Append an item to the end of the playlist.
8182
8215
  * This method cannot be called before
8183
- * {@link clpp.plist.ScPlaylist#open|open()}.
8216
+ * {@link clpp.playlist.ScPlaylist#open|open()}.
8184
8217
  *
8185
8218
  * @param config an item which must contain
8186
8219
  * at least an `id` and a `source`.
@@ -8306,6 +8339,83 @@ export namespace clpp {
8306
8339
  }
8307
8340
  }
8308
8341
 
8342
+ namespace plist {
8343
+ /**
8344
+ * A playlist item.
8345
+ * It consists of an asset/config, a player instances selected
8346
+ * to play this asset and the underlying video element to which the player is
8347
+ * attached.
8348
+ */
8349
+ export type Item = {
8350
+ /**
8351
+ * Source configuration.
8352
+ */
8353
+ config: clpp.PlayerConfiguration;
8354
+ /**
8355
+ * The index of the item in the playlist.
8356
+ */
8357
+ index: number;
8358
+ /**
8359
+ * A player instance.
8360
+ */
8361
+ player: clpp.Player|null;
8362
+ /**
8363
+ * A promise that resolves when the item is preloaded.
8364
+ */
8365
+ preloadPromise: Promise<void>;
8366
+ /**
8367
+ * The role of the item.
8368
+ */
8369
+ role: string;
8370
+ /**
8371
+ * The state of the item (e.g. 'preloading', 'preloaded', 'preload-failed').
8372
+ */
8373
+ state: string;
8374
+ /**
8375
+ * The video element attached to the player.
8376
+ */
8377
+ videoEl: HTMLVideoElement|null;
8378
+ }
8379
+
8380
+ /**
8381
+ * Playlist options.
8382
+ */
8383
+ export type Options = {
8384
+ /**
8385
+ * ID of the HTML element to be used as a container
8386
+ * for video elements created by this playlist.
8387
+ */
8388
+ anchorId: string;
8389
+ /**
8390
+ * If true, when one item finishes playback the next item is played
8391
+ * automatically and so on until the end of the playlist.
8392
+ */
8393
+ autoplayNext?: boolean;
8394
+ /**
8395
+ * Default configuration for player instances.
8396
+ */
8397
+ config: clpp.PlayerConfiguration;
8398
+ /**
8399
+ * If true, preloaded items will have also their media segments preloaded
8400
+ * thus reducing the time to start playback to minimum. This option is
8401
+ * intended to be used with VOD streams.
8402
+ */
8403
+ preloadMedia?: boolean;
8404
+ /**
8405
+ * A custom callback to toggle the visibility of a video element. By default
8406
+ * this is done via z-index.
8407
+ */
8408
+ toggleVisible?: Function;
8409
+ /**
8410
+ * Transition method, can be "pause" or "keep-playing". In cause of "pause"
8411
+ * the current video will be paused when calling
8412
+ * {@link clpp.playlist.McPlaylist.playNext} or
8413
+ * {@link clpp.playlist.McPlaylist.playPrev}.
8414
+ */
8415
+ transition?: string;
8416
+ }
8417
+ }
8418
+
8309
8419
  namespace smooth {
8310
8420
  export class SmoothComponent {
8311
8421