hls.js 1.5.14-0.canary.10601 → 1.5.14-0.canary.10603

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.light.js CHANGED
@@ -494,7 +494,7 @@
494
494
  // Some browsers don't allow to use bind on console object anyway
495
495
  // fallback to default if needed
496
496
  try {
497
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.14-0.canary.10601");
497
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.14-0.canary.10603");
498
498
  } catch (e) {
499
499
  /* log fn threw an exception. All logger methods are no-ops. */
500
500
  return createLogger();
@@ -4011,11 +4011,13 @@
4011
4011
  return cuesFound;
4012
4012
  }
4013
4013
 
4014
- var MetadataSchema = {
4015
- audioId3: "org.id3",
4016
- dateRange: "com.apple.quicktime.HLS",
4017
- emsg: "https://aomedia.org/emsg/ID3"
4018
- };
4014
+ var MetadataSchema = /*#__PURE__*/function (MetadataSchema) {
4015
+ MetadataSchema["audioId3"] = "org.id3";
4016
+ MetadataSchema["dateRange"] = "com.apple.quicktime.HLS";
4017
+ MetadataSchema["emsg"] = "https://aomedia.org/emsg/ID3";
4018
+ MetadataSchema["misbklv"] = "urn:misb:KLV:bin:1910.1";
4019
+ return MetadataSchema;
4020
+ }({});
4019
4021
 
4020
4022
  /**
4021
4023
  * Decode an ID3 PRIV frame.
@@ -10176,6 +10178,7 @@
10176
10178
  cmcd: undefined,
10177
10179
  enableDateRangeMetadataCues: true,
10178
10180
  enableEmsgMetadataCues: true,
10181
+ enableEmsgKLVMetadata: false,
10179
10182
  enableID3MetadataCues: true,
10180
10183
  useMediaCapabilities: false,
10181
10184
  certLoadPolicy: {
@@ -14942,6 +14945,7 @@
14942
14945
  };
14943
14946
  };
14944
14947
  _proto.extractID3Track = function extractID3Track(videoTrack, timeOffset) {
14948
+ var _this = this;
14945
14949
  var id3Track = this.id3Track;
14946
14950
  if (videoTrack.samples.length) {
14947
14951
  var emsgs = findBox(videoTrack.samples, ['emsg']);
@@ -14949,7 +14953,7 @@
14949
14953
  emsgs.forEach(function (data) {
14950
14954
  var emsgInfo = parseEmsg(data);
14951
14955
  if (emsgSchemePattern.test(emsgInfo.schemeIdUri)) {
14952
- var pts = isFiniteNumber(emsgInfo.presentationTime) ? emsgInfo.presentationTime / emsgInfo.timeScale : timeOffset + emsgInfo.presentationTimeDelta / emsgInfo.timeScale;
14956
+ var pts = getEmsgStartTime(emsgInfo, timeOffset);
14953
14957
  var duration = emsgInfo.eventDuration === 0xffffffff ? Number.POSITIVE_INFINITY : emsgInfo.eventDuration / emsgInfo.timeScale;
14954
14958
  // Safari takes anything <= 0.001 seconds and maps it to Infinity
14955
14959
  if (duration <= 0.001) {
@@ -14964,6 +14968,16 @@
14964
14968
  type: MetadataSchema.emsg,
14965
14969
  duration: duration
14966
14970
  });
14971
+ } else if (_this.config.enableEmsgKLVMetadata && emsgInfo.schemeIdUri.startsWith('urn:misb:KLV:bin:1910.1')) {
14972
+ var _pts = getEmsgStartTime(emsgInfo, timeOffset);
14973
+ id3Track.samples.push({
14974
+ data: emsgInfo.payload,
14975
+ len: emsgInfo.payload.byteLength,
14976
+ dts: _pts,
14977
+ pts: _pts,
14978
+ type: MetadataSchema.misbklv,
14979
+ duration: Number.POSITIVE_INFINITY
14980
+ });
14967
14981
  }
14968
14982
  });
14969
14983
  }
@@ -14981,6 +14995,9 @@
14981
14995
  };
14982
14996
  return MP4Demuxer;
14983
14997
  }();
14998
+ function getEmsgStartTime(emsgInfo, timeOffset) {
14999
+ return isFiniteNumber(emsgInfo.presentationTime) ? emsgInfo.presentationTime / emsgInfo.timeScale : timeOffset + emsgInfo.presentationTimeDelta / emsgInfo.timeScale;
15000
+ }
14984
15001
 
14985
15002
  var getAudioBSID = function getAudioBSID(data, offset) {
14986
15003
  // check the bsid to confirm ac-3 | ec-3
@@ -19284,7 +19301,7 @@
19284
19301
  return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
19285
19302
  }
19286
19303
 
19287
- var version = "1.5.14-0.canary.10601";
19304
+ var version = "1.5.14-0.canary.10603";
19288
19305
 
19289
19306
  // ensure the worker ends up in the bundle
19290
19307
  // If the worker should not be included this gets aliased to empty.js
@@ -22033,6 +22050,11 @@
22033
22050
  get: function get() {
22034
22051
  return Events;
22035
22052
  }
22053
+ }, {
22054
+ key: "MetadataSchema",
22055
+ get: function get() {
22056
+ return MetadataSchema;
22057
+ }
22036
22058
  }, {
22037
22059
  key: "ErrorTypes",
22038
22060
  get: function get() {