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.
@@ -421,7 +421,7 @@ function enableLogs(debugConfig, context, id) {
421
421
  // Some browsers don't allow to use bind on console object anyway
422
422
  // fallback to default if needed
423
423
  try {
424
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.14-0.canary.10601"}`);
424
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.14-0.canary.10603"}`);
425
425
  } catch (e) {
426
426
  /* log fn threw an exception. All logger methods are no-ops. */
427
427
  return createLogger();
@@ -3831,11 +3831,13 @@ function getCuesInRange(cues, start, end) {
3831
3831
  return cuesFound;
3832
3832
  }
3833
3833
 
3834
- var MetadataSchema = {
3835
- audioId3: "org.id3",
3836
- dateRange: "com.apple.quicktime.HLS",
3837
- emsg: "https://aomedia.org/emsg/ID3"
3838
- };
3834
+ let MetadataSchema = /*#__PURE__*/function (MetadataSchema) {
3835
+ MetadataSchema["audioId3"] = "org.id3";
3836
+ MetadataSchema["dateRange"] = "com.apple.quicktime.HLS";
3837
+ MetadataSchema["emsg"] = "https://aomedia.org/emsg/ID3";
3838
+ MetadataSchema["misbklv"] = "urn:misb:KLV:bin:1910.1";
3839
+ return MetadataSchema;
3840
+ }({});
3839
3841
 
3840
3842
  /**
3841
3843
  * Decode an ID3 PRIV frame.
@@ -9898,6 +9900,7 @@ const hlsDefaultConfig = _objectSpread2(_objectSpread2({
9898
9900
  cmcd: undefined,
9899
9901
  enableDateRangeMetadataCues: true,
9900
9902
  enableEmsgMetadataCues: true,
9903
+ enableEmsgKLVMetadata: false,
9901
9904
  enableID3MetadataCues: true,
9902
9905
  useMediaCapabilities: false,
9903
9906
  certLoadPolicy: {
@@ -13864,7 +13867,7 @@ function changeTypeSupported() {
13864
13867
  return typeof (sourceBuffer == null ? void 0 : (_sourceBuffer$prototy = sourceBuffer.prototype) == null ? void 0 : _sourceBuffer$prototy.changeType) === 'function';
13865
13868
  }
13866
13869
 
13867
- const version = "1.5.14-0.canary.10601";
13870
+ const version = "1.5.14-0.canary.10603";
13868
13871
 
13869
13872
  // ensure the worker ends up in the bundle
13870
13873
  // If the worker should not be included this gets aliased to empty.js
@@ -14678,7 +14681,7 @@ class MP4Demuxer {
14678
14681
  emsgs.forEach(data => {
14679
14682
  const emsgInfo = parseEmsg(data);
14680
14683
  if (emsgSchemePattern.test(emsgInfo.schemeIdUri)) {
14681
- const pts = isFiniteNumber(emsgInfo.presentationTime) ? emsgInfo.presentationTime / emsgInfo.timeScale : timeOffset + emsgInfo.presentationTimeDelta / emsgInfo.timeScale;
14684
+ const pts = getEmsgStartTime(emsgInfo, timeOffset);
14682
14685
  let duration = emsgInfo.eventDuration === 0xffffffff ? Number.POSITIVE_INFINITY : emsgInfo.eventDuration / emsgInfo.timeScale;
14683
14686
  // Safari takes anything <= 0.001 seconds and maps it to Infinity
14684
14687
  if (duration <= 0.001) {
@@ -14693,6 +14696,16 @@ class MP4Demuxer {
14693
14696
  type: MetadataSchema.emsg,
14694
14697
  duration: duration
14695
14698
  });
14699
+ } else if (this.config.enableEmsgKLVMetadata && emsgInfo.schemeIdUri.startsWith('urn:misb:KLV:bin:1910.1')) {
14700
+ const pts = getEmsgStartTime(emsgInfo, timeOffset);
14701
+ id3Track.samples.push({
14702
+ data: emsgInfo.payload,
14703
+ len: emsgInfo.payload.byteLength,
14704
+ dts: pts,
14705
+ pts: pts,
14706
+ type: MetadataSchema.misbklv,
14707
+ duration: Number.POSITIVE_INFINITY
14708
+ });
14696
14709
  }
14697
14710
  });
14698
14711
  }
@@ -14709,6 +14722,9 @@ class MP4Demuxer {
14709
14722
  this.videoTrack = this.audioTrack = this.id3Track = this.txtTrack = undefined;
14710
14723
  }
14711
14724
  }
14725
+ function getEmsgStartTime(emsgInfo, timeOffset) {
14726
+ return isFiniteNumber(emsgInfo.presentationTime) ? emsgInfo.presentationTime / emsgInfo.timeScale : timeOffset + emsgInfo.presentationTimeDelta / emsgInfo.timeScale;
14727
+ }
14712
14728
 
14713
14729
  const getAudioBSID = (data, offset) => {
14714
14730
  // check the bsid to confirm ac-3 | ec-3
@@ -20689,6 +20705,9 @@ class Hls {
20689
20705
  static get Events() {
20690
20706
  return Events;
20691
20707
  }
20708
+ static get MetadataSchema() {
20709
+ return MetadataSchema;
20710
+ }
20692
20711
  static get ErrorTypes() {
20693
20712
  return ErrorTypes;
20694
20713
  }