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.mjs CHANGED
@@ -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();
@@ -4320,11 +4320,13 @@ function filterSubtitleTracks(textTrackList) {
4320
4320
  return tracks;
4321
4321
  }
4322
4322
 
4323
- var MetadataSchema = {
4324
- audioId3: "org.id3",
4325
- dateRange: "com.apple.quicktime.HLS",
4326
- emsg: "https://aomedia.org/emsg/ID3"
4327
- };
4323
+ let MetadataSchema = /*#__PURE__*/function (MetadataSchema) {
4324
+ MetadataSchema["audioId3"] = "org.id3";
4325
+ MetadataSchema["dateRange"] = "com.apple.quicktime.HLS";
4326
+ MetadataSchema["emsg"] = "https://aomedia.org/emsg/ID3";
4327
+ MetadataSchema["misbklv"] = "urn:misb:KLV:bin:1910.1";
4328
+ return MetadataSchema;
4329
+ }({});
4328
4330
 
4329
4331
  /**
4330
4332
  * Decode an ID3 PRIV frame.
@@ -11079,7 +11081,7 @@ function concatUint8Arrays(chunks, dataLength) {
11079
11081
  return result;
11080
11082
  }
11081
11083
 
11082
- const version = "1.5.14-0.canary.10601";
11084
+ const version = "1.5.14-0.canary.10603";
11083
11085
 
11084
11086
  // ensure the worker ends up in the bundle
11085
11087
  // If the worker should not be included this gets aliased to empty.js
@@ -11893,7 +11895,7 @@ class MP4Demuxer {
11893
11895
  emsgs.forEach(data => {
11894
11896
  const emsgInfo = parseEmsg(data);
11895
11897
  if (emsgSchemePattern.test(emsgInfo.schemeIdUri)) {
11896
- const pts = isFiniteNumber(emsgInfo.presentationTime) ? emsgInfo.presentationTime / emsgInfo.timeScale : timeOffset + emsgInfo.presentationTimeDelta / emsgInfo.timeScale;
11898
+ const pts = getEmsgStartTime(emsgInfo, timeOffset);
11897
11899
  let duration = emsgInfo.eventDuration === 0xffffffff ? Number.POSITIVE_INFINITY : emsgInfo.eventDuration / emsgInfo.timeScale;
11898
11900
  // Safari takes anything <= 0.001 seconds and maps it to Infinity
11899
11901
  if (duration <= 0.001) {
@@ -11908,6 +11910,16 @@ class MP4Demuxer {
11908
11910
  type: MetadataSchema.emsg,
11909
11911
  duration: duration
11910
11912
  });
11913
+ } else if (this.config.enableEmsgKLVMetadata && emsgInfo.schemeIdUri.startsWith('urn:misb:KLV:bin:1910.1')) {
11914
+ const pts = getEmsgStartTime(emsgInfo, timeOffset);
11915
+ id3Track.samples.push({
11916
+ data: emsgInfo.payload,
11917
+ len: emsgInfo.payload.byteLength,
11918
+ dts: pts,
11919
+ pts: pts,
11920
+ type: MetadataSchema.misbklv,
11921
+ duration: Number.POSITIVE_INFINITY
11922
+ });
11911
11923
  }
11912
11924
  });
11913
11925
  }
@@ -11924,6 +11936,9 @@ class MP4Demuxer {
11924
11936
  this.videoTrack = this.audioTrack = this.id3Track = this.txtTrack = undefined;
11925
11937
  }
11926
11938
  }
11939
+ function getEmsgStartTime(emsgInfo, timeOffset) {
11940
+ return isFiniteNumber(emsgInfo.presentationTime) ? emsgInfo.presentationTime / emsgInfo.timeScale : timeOffset + emsgInfo.presentationTimeDelta / emsgInfo.timeScale;
11941
+ }
11927
11942
 
11928
11943
  const getAudioBSID = (data, offset) => {
11929
11944
  // check the bsid to confirm ac-3 | ec-3
@@ -26801,6 +26816,7 @@ const hlsDefaultConfig = _objectSpread2(_objectSpread2({
26801
26816
  cmcd: undefined,
26802
26817
  enableDateRangeMetadataCues: true,
26803
26818
  enableEmsgMetadataCues: true,
26819
+ enableEmsgKLVMetadata: false,
26804
26820
  enableID3MetadataCues: true,
26805
26821
  useMediaCapabilities: true,
26806
26822
  certLoadPolicy: {
@@ -29399,6 +29415,9 @@ class Hls {
29399
29415
  static get Events() {
29400
29416
  return Events;
29401
29417
  }
29418
+ static get MetadataSchema() {
29419
+ return MetadataSchema;
29420
+ }
29402
29421
  static get ErrorTypes() {
29403
29422
  return ErrorTypes;
29404
29423
  }