hls.js 1.6.0-beta.1.0.canary.10746 → 1.6.0-beta.1.0.canary.10749

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/dist/hls.mjs CHANGED
@@ -28,6 +28,9 @@ let ErrorDetails = /*#__PURE__*/function (ErrorDetails) {
28
28
  ErrorDetails["KEY_SYSTEM_SESSION_UPDATE_FAILED"] = "keySystemSessionUpdateFailed";
29
29
  ErrorDetails["KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED"] = "keySystemStatusOutputRestricted";
30
30
  ErrorDetails["KEY_SYSTEM_STATUS_INTERNAL_ERROR"] = "keySystemStatusInternalError";
31
+ ErrorDetails["KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR"] = "keySystemDestroyMediaKeysError";
32
+ ErrorDetails["KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR"] = "keySystemDestroyCloseSessionError";
33
+ ErrorDetails["KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR"] = "keySystemDestroyRemoveSessionError";
31
34
  ErrorDetails["MANIFEST_LOAD_ERROR"] = "manifestLoadError";
32
35
  ErrorDetails["MANIFEST_LOAD_TIMEOUT"] = "manifestLoadTimeOut";
33
36
  ErrorDetails["MANIFEST_PARSING_ERROR"] = "manifestParsingError";
@@ -397,7 +400,7 @@ function enableLogs(debugConfig, context, id) {
397
400
  // Some browsers don't allow to use bind on console object anyway
398
401
  // fallback to default if needed
399
402
  try {
400
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.10746"}`);
403
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.10749"}`);
401
404
  } catch (e) {
402
405
  /* log fn threw an exception. All logger methods are no-ops. */
403
406
  return createLogger();
@@ -9726,7 +9729,7 @@ var eventemitter3 = {exports: {}};
9726
9729
  var eventemitter3Exports = eventemitter3.exports;
9727
9730
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
9728
9731
 
9729
- const version = "1.6.0-beta.1.0.canary.10746";
9732
+ const version = "1.6.0-beta.1.0.canary.10749";
9730
9733
 
9731
9734
  // ensure the worker ends up in the bundle
9732
9735
  // If the worker should not be included this gets aliased to empty.js
@@ -19184,105 +19187,158 @@ class CapLevelController {
19184
19187
  }
19185
19188
 
19186
19189
  /**
19187
- * Common Media Client Data Object Type
19188
- *
19189
- * @group CMCD
19190
+ * Common Media Object Type
19190
19191
  *
19191
- * @beta
19192
+ * @internal
19192
19193
  */
19193
- var CmcdObjectType;
19194
- (function (CmcdObjectType) {
19194
+ const CmObjectType = {
19195
19195
  /**
19196
19196
  * text file, such as a manifest or playlist
19197
19197
  */
19198
- CmcdObjectType["MANIFEST"] = "m";
19198
+ MANIFEST: 'm',
19199
19199
  /**
19200
19200
  * audio only
19201
19201
  */
19202
- CmcdObjectType["AUDIO"] = "a";
19202
+ AUDIO: 'a',
19203
19203
  /**
19204
19204
  * video only
19205
19205
  */
19206
- CmcdObjectType["VIDEO"] = "v";
19206
+ VIDEO: 'v',
19207
19207
  /**
19208
19208
  * muxed audio and video
19209
19209
  */
19210
- CmcdObjectType["MUXED"] = "av";
19210
+ MUXED: 'av',
19211
19211
  /**
19212
19212
  * init segment
19213
19213
  */
19214
- CmcdObjectType["INIT"] = "i";
19214
+ INIT: 'i',
19215
19215
  /**
19216
19216
  * caption or subtitle
19217
19217
  */
19218
- CmcdObjectType["CAPTION"] = "c";
19218
+ CAPTION: 'c',
19219
19219
  /**
19220
19220
  * ISOBMFF timed text track
19221
19221
  */
19222
- CmcdObjectType["TIMED_TEXT"] = "tt";
19222
+ TIMED_TEXT: 'tt',
19223
19223
  /**
19224
19224
  * cryptographic key, license or certificate.
19225
19225
  */
19226
- CmcdObjectType["KEY"] = "k";
19226
+ KEY: 'k',
19227
19227
  /**
19228
19228
  * other
19229
19229
  */
19230
- CmcdObjectType["OTHER"] = "o";
19231
- })(CmcdObjectType || (CmcdObjectType = {}));
19230
+ OTHER: 'o'
19231
+ };
19232
19232
 
19233
19233
  /**
19234
- * Common Media Client Data Streaming Format
19234
+ * Common Media Client Data Object Type
19235
19235
  *
19236
19236
  * @group CMCD
19237
19237
  *
19238
19238
  * @beta
19239
+ *
19240
+ * @enum
19239
19241
  */
19240
- var CmcdStreamingFormat;
19241
- (function (CmcdStreamingFormat) {
19242
+ const CmcdObjectType = CmObjectType;
19243
+
19244
+ /**
19245
+ * Common Media Streaming Format
19246
+ *
19247
+ * @internal
19248
+ */
19249
+ const CmStreamingFormat = {
19242
19250
  /**
19243
19251
  * MPEG DASH
19244
19252
  */
19245
- CmcdStreamingFormat["DASH"] = "d";
19253
+ DASH: 'd',
19246
19254
  /**
19247
19255
  * HTTP Live Streaming (HLS)
19248
19256
  */
19249
- CmcdStreamingFormat["HLS"] = "h";
19257
+ HLS: 'h',
19250
19258
  /**
19251
19259
  * Smooth Streaming
19252
19260
  */
19253
- CmcdStreamingFormat["SMOOTH"] = "s";
19261
+ SMOOTH: 's',
19254
19262
  /**
19255
19263
  * Other
19256
19264
  */
19257
- CmcdStreamingFormat["OTHER"] = "o";
19258
- })(CmcdStreamingFormat || (CmcdStreamingFormat = {}));
19265
+ OTHER: 'o'
19266
+ };
19267
+
19268
+ /**
19269
+ * Common Media Client Data Streaming Format
19270
+ *
19271
+ * @group CMCD
19272
+ *
19273
+ * @enum
19274
+ *
19275
+ * @beta
19276
+ */
19277
+ const CmcdStreamingFormat = CmStreamingFormat;
19278
+
19279
+ /**
19280
+ * CMCD object header name.
19281
+ *
19282
+ * @group CMCD
19283
+ *
19284
+ * @beta
19285
+ */
19286
+ const CMCD_OBJECT = 'CMCD-Object';
19287
+
19288
+ /**
19289
+ * CMCD request header name.
19290
+ *
19291
+ * @group CMCD
19292
+ *
19293
+ * @beta
19294
+ */
19295
+ const CMCD_REQUEST = 'CMCD-Request';
19296
+
19297
+ /**
19298
+ * CMCD session header name.
19299
+ *
19300
+ * @group CMCD
19301
+ *
19302
+ * @beta
19303
+ */
19304
+ const CMCD_SESSION = 'CMCD-Session';
19305
+
19306
+ /**
19307
+ * CMCD status header name.
19308
+ *
19309
+ * @group CMCD
19310
+ *
19311
+ * @beta
19312
+ */
19313
+ const CMCD_STATUS = 'CMCD-Status';
19259
19314
 
19260
19315
  /**
19261
19316
  * CMCD header fields.
19262
19317
  *
19263
19318
  * @group CMCD
19264
19319
  *
19320
+ * @enum
19321
+ *
19265
19322
  * @beta
19266
19323
  */
19267
- var CmcdHeaderField;
19268
- (function (CmcdHeaderField) {
19324
+ const CmcdHeaderField = {
19269
19325
  /**
19270
19326
  * keys whose values vary with the object being requested.
19271
19327
  */
19272
- CmcdHeaderField["OBJECT"] = "CMCD-Object";
19328
+ OBJECT: CMCD_OBJECT,
19273
19329
  /**
19274
19330
  * keys whose values vary with each request.
19275
19331
  */
19276
- CmcdHeaderField["REQUEST"] = "CMCD-Request";
19332
+ REQUEST: CMCD_REQUEST,
19277
19333
  /**
19278
19334
  * keys whose values are expected to be invariant over the life of the session.
19279
19335
  */
19280
- CmcdHeaderField["SESSION"] = "CMCD-Session";
19336
+ SESSION: CMCD_SESSION,
19281
19337
  /**
19282
19338
  * keys whose values do not vary with every request or object.
19283
19339
  */
19284
- CmcdHeaderField["STATUS"] = "CMCD-Status";
19285
- })(CmcdHeaderField || (CmcdHeaderField = {}));
19340
+ STATUS: CMCD_STATUS
19341
+ };
19286
19342
 
19287
19343
  /**
19288
19344
  * The map of CMCD header fields to official CMCD keys.
@@ -21661,14 +21717,28 @@ class EMEController extends Logger {
21661
21717
  // Close all sessions and remove media keys from the video element.
21662
21718
  const keySessionCount = mediaKeysList.length;
21663
21719
  EMEController.CDMCleanupPromise = Promise.all(mediaKeysList.map(mediaKeySessionContext => this.removeSession(mediaKeySessionContext)).concat(media == null ? void 0 : (_media$setMediaKeys = media.setMediaKeys(null)) == null ? void 0 : _media$setMediaKeys.catch(error => {
21720
+ var _this$hls2;
21664
21721
  this.log(`Could not clear media keys: ${error}`);
21722
+ (_this$hls2 = this.hls) == null ? void 0 : _this$hls2.trigger(Events.ERROR, {
21723
+ type: ErrorTypes.OTHER_ERROR,
21724
+ details: ErrorDetails.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,
21725
+ fatal: false,
21726
+ error: new Error(`Could not clear media keys: ${error}`)
21727
+ });
21665
21728
  }))).then(() => {
21666
21729
  if (keySessionCount) {
21667
21730
  this.log('finished closing key sessions and clearing media keys');
21668
21731
  mediaKeysList.length = 0;
21669
21732
  }
21670
21733
  }).catch(error => {
21734
+ var _this$hls3;
21671
21735
  this.log(`Could not close sessions and clear media keys: ${error}`);
21736
+ (_this$hls3 = this.hls) == null ? void 0 : _this$hls3.trigger(Events.ERROR, {
21737
+ type: ErrorTypes.OTHER_ERROR,
21738
+ details: ErrorDetails.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,
21739
+ fatal: false,
21740
+ error: new Error(`Could not close sessions and clear media keys: ${error}`)
21741
+ });
21672
21742
  });
21673
21743
  }
21674
21744
  onManifestLoading() {
@@ -21715,11 +21785,25 @@ class EMEController extends Logger {
21715
21785
  this.mediaKeySessions.splice(index, 1);
21716
21786
  }
21717
21787
  return mediaKeysSession.remove().catch(error => {
21788
+ var _this$hls4;
21718
21789
  this.log(`Could not remove session: ${error}`);
21790
+ (_this$hls4 = this.hls) == null ? void 0 : _this$hls4.trigger(Events.ERROR, {
21791
+ type: ErrorTypes.OTHER_ERROR,
21792
+ details: ErrorDetails.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,
21793
+ fatal: false,
21794
+ error: new Error(`Could not remove session: ${error}`)
21795
+ });
21719
21796
  }).then(() => {
21720
21797
  return mediaKeysSession.close();
21721
21798
  }).catch(error => {
21799
+ var _this$hls5;
21722
21800
  this.log(`Could not close session: ${error}`);
21801
+ (_this$hls5 = this.hls) == null ? void 0 : _this$hls5.trigger(Events.ERROR, {
21802
+ type: ErrorTypes.OTHER_ERROR,
21803
+ details: ErrorDetails.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,
21804
+ fatal: false,
21805
+ error: new Error(`Could not close session: ${error}`)
21806
+ });
21723
21807
  });
21724
21808
  }
21725
21809
  }