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.d.mts CHANGED
@@ -1395,6 +1395,7 @@ declare class Hls implements HlsEventEmitter {
1395
1395
  */
1396
1396
  static getMediaSource(): typeof MediaSource | undefined;
1397
1397
  static get Events(): typeof Events;
1398
+ static get MetadataSchema(): typeof MetadataSchema;
1398
1399
  static get ErrorTypes(): typeof ErrorTypes;
1399
1400
  static get ErrorDetails(): typeof ErrorDetails;
1400
1401
  /**
@@ -2445,6 +2446,7 @@ export declare type MediaPlaylistType = MainPlaylistType | SubtitlePlaylistType;
2445
2446
  export declare type MetadataControllerConfig = {
2446
2447
  enableDateRangeMetadataCues: boolean;
2447
2448
  enableEmsgMetadataCues: boolean;
2449
+ enableEmsgKLVMetadata: boolean;
2448
2450
  enableID3MetadataCues: boolean;
2449
2451
  };
2450
2452
 
@@ -2457,10 +2459,11 @@ export declare interface MetadataSample {
2457
2459
  type: MetadataSchema;
2458
2460
  }
2459
2461
 
2460
- export declare const enum MetadataSchema {
2462
+ export declare enum MetadataSchema {
2461
2463
  audioId3 = "org.id3",
2462
2464
  dateRange = "com.apple.quicktime.HLS",
2463
- emsg = "https://aomedia.org/emsg/ID3"
2465
+ emsg = "https://aomedia.org/emsg/ID3",
2466
+ misbklv = "urn:misb:KLV:bin:1910.1"
2464
2467
  }
2465
2468
 
2466
2469
  export declare type MP4RemuxerConfig = {
package/dist/hls.d.ts CHANGED
@@ -1395,6 +1395,7 @@ declare class Hls implements HlsEventEmitter {
1395
1395
  */
1396
1396
  static getMediaSource(): typeof MediaSource | undefined;
1397
1397
  static get Events(): typeof Events;
1398
+ static get MetadataSchema(): typeof MetadataSchema;
1398
1399
  static get ErrorTypes(): typeof ErrorTypes;
1399
1400
  static get ErrorDetails(): typeof ErrorDetails;
1400
1401
  /**
@@ -2445,6 +2446,7 @@ export declare type MediaPlaylistType = MainPlaylistType | SubtitlePlaylistType;
2445
2446
  export declare type MetadataControllerConfig = {
2446
2447
  enableDateRangeMetadataCues: boolean;
2447
2448
  enableEmsgMetadataCues: boolean;
2449
+ enableEmsgKLVMetadata: boolean;
2448
2450
  enableID3MetadataCues: boolean;
2449
2451
  };
2450
2452
 
@@ -2457,10 +2459,11 @@ export declare interface MetadataSample {
2457
2459
  type: MetadataSchema;
2458
2460
  }
2459
2461
 
2460
- export declare const enum MetadataSchema {
2462
+ export declare enum MetadataSchema {
2461
2463
  audioId3 = "org.id3",
2462
2464
  dateRange = "com.apple.quicktime.HLS",
2463
- emsg = "https://aomedia.org/emsg/ID3"
2465
+ emsg = "https://aomedia.org/emsg/ID3",
2466
+ misbklv = "urn:misb:KLV:bin:1910.1"
2464
2467
  }
2465
2468
 
2466
2469
  export declare type MP4RemuxerConfig = {
package/dist/hls.js CHANGED
@@ -523,7 +523,7 @@
523
523
  // Some browsers don't allow to use bind on console object anyway
524
524
  // fallback to default if needed
525
525
  try {
526
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.14-0.canary.10601");
526
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.14-0.canary.10603");
527
527
  } catch (e) {
528
528
  /* log fn threw an exception. All logger methods are no-ops. */
529
529
  return createLogger();
@@ -4542,11 +4542,13 @@
4542
4542
  return tracks;
4543
4543
  }
4544
4544
 
4545
- var MetadataSchema = {
4546
- audioId3: "org.id3",
4547
- dateRange: "com.apple.quicktime.HLS",
4548
- emsg: "https://aomedia.org/emsg/ID3"
4549
- };
4545
+ var MetadataSchema = /*#__PURE__*/function (MetadataSchema) {
4546
+ MetadataSchema["audioId3"] = "org.id3";
4547
+ MetadataSchema["dateRange"] = "com.apple.quicktime.HLS";
4548
+ MetadataSchema["emsg"] = "https://aomedia.org/emsg/ID3";
4549
+ MetadataSchema["misbklv"] = "urn:misb:KLV:bin:1910.1";
4550
+ return MetadataSchema;
4551
+ }({});
4550
4552
 
4551
4553
  /**
4552
4554
  * Decode an ID3 PRIV frame.
@@ -12177,6 +12179,7 @@
12177
12179
  };
12178
12180
  };
12179
12181
  _proto.extractID3Track = function extractID3Track(videoTrack, timeOffset) {
12182
+ var _this = this;
12180
12183
  var id3Track = this.id3Track;
12181
12184
  if (videoTrack.samples.length) {
12182
12185
  var emsgs = findBox(videoTrack.samples, ['emsg']);
@@ -12184,7 +12187,7 @@
12184
12187
  emsgs.forEach(function (data) {
12185
12188
  var emsgInfo = parseEmsg(data);
12186
12189
  if (emsgSchemePattern.test(emsgInfo.schemeIdUri)) {
12187
- var pts = isFiniteNumber(emsgInfo.presentationTime) ? emsgInfo.presentationTime / emsgInfo.timeScale : timeOffset + emsgInfo.presentationTimeDelta / emsgInfo.timeScale;
12190
+ var pts = getEmsgStartTime(emsgInfo, timeOffset);
12188
12191
  var duration = emsgInfo.eventDuration === 0xffffffff ? Number.POSITIVE_INFINITY : emsgInfo.eventDuration / emsgInfo.timeScale;
12189
12192
  // Safari takes anything <= 0.001 seconds and maps it to Infinity
12190
12193
  if (duration <= 0.001) {
@@ -12199,6 +12202,16 @@
12199
12202
  type: MetadataSchema.emsg,
12200
12203
  duration: duration
12201
12204
  });
12205
+ } else if (_this.config.enableEmsgKLVMetadata && emsgInfo.schemeIdUri.startsWith('urn:misb:KLV:bin:1910.1')) {
12206
+ var _pts = getEmsgStartTime(emsgInfo, timeOffset);
12207
+ id3Track.samples.push({
12208
+ data: emsgInfo.payload,
12209
+ len: emsgInfo.payload.byteLength,
12210
+ dts: _pts,
12211
+ pts: _pts,
12212
+ type: MetadataSchema.misbklv,
12213
+ duration: Number.POSITIVE_INFINITY
12214
+ });
12202
12215
  }
12203
12216
  });
12204
12217
  }
@@ -12216,6 +12229,9 @@
12216
12229
  };
12217
12230
  return MP4Demuxer;
12218
12231
  }();
12232
+ function getEmsgStartTime(emsgInfo, timeOffset) {
12233
+ return isFiniteNumber(emsgInfo.presentationTime) ? emsgInfo.presentationTime / emsgInfo.timeScale : timeOffset + emsgInfo.presentationTimeDelta / emsgInfo.timeScale;
12234
+ }
12219
12235
 
12220
12236
  var getAudioBSID = function getAudioBSID(data, offset) {
12221
12237
  // check the bsid to confirm ac-3 | ec-3
@@ -17311,7 +17327,7 @@
17311
17327
  return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
17312
17328
  }
17313
17329
 
17314
- var version = "1.5.14-0.canary.10601";
17330
+ var version = "1.5.14-0.canary.10603";
17315
17331
 
17316
17332
  // ensure the worker ends up in the bundle
17317
17333
  // If the worker should not be included this gets aliased to empty.js
@@ -27462,6 +27478,7 @@
27462
27478
  cmcd: undefined,
27463
27479
  enableDateRangeMetadataCues: true,
27464
27480
  enableEmsgMetadataCues: true,
27481
+ enableEmsgKLVMetadata: false,
27465
27482
  enableID3MetadataCues: true,
27466
27483
  useMediaCapabilities: true,
27467
27484
  certLoadPolicy: {
@@ -30920,6 +30937,11 @@
30920
30937
  get: function get() {
30921
30938
  return Events;
30922
30939
  }
30940
+ }, {
30941
+ key: "MetadataSchema",
30942
+ get: function get() {
30943
+ return MetadataSchema;
30944
+ }
30923
30945
  }, {
30924
30946
  key: "ErrorTypes",
30925
30947
  get: function get() {
package/dist/hls.js.d.ts CHANGED
@@ -1395,6 +1395,7 @@ declare class Hls implements HlsEventEmitter {
1395
1395
  */
1396
1396
  static getMediaSource(): typeof MediaSource | undefined;
1397
1397
  static get Events(): typeof Events;
1398
+ static get MetadataSchema(): typeof MetadataSchema;
1398
1399
  static get ErrorTypes(): typeof ErrorTypes;
1399
1400
  static get ErrorDetails(): typeof ErrorDetails;
1400
1401
  /**
@@ -2445,6 +2446,7 @@ export declare type MediaPlaylistType = MainPlaylistType | SubtitlePlaylistType;
2445
2446
  export declare type MetadataControllerConfig = {
2446
2447
  enableDateRangeMetadataCues: boolean;
2447
2448
  enableEmsgMetadataCues: boolean;
2449
+ enableEmsgKLVMetadata: boolean;
2448
2450
  enableID3MetadataCues: boolean;
2449
2451
  };
2450
2452
 
@@ -2457,10 +2459,11 @@ export declare interface MetadataSample {
2457
2459
  type: MetadataSchema;
2458
2460
  }
2459
2461
 
2460
- export declare const enum MetadataSchema {
2462
+ export declare enum MetadataSchema {
2461
2463
  audioId3 = "org.id3",
2462
2464
  dateRange = "com.apple.quicktime.HLS",
2463
- emsg = "https://aomedia.org/emsg/ID3"
2465
+ emsg = "https://aomedia.org/emsg/ID3",
2466
+ misbklv = "urn:misb:KLV:bin:1910.1"
2464
2467
  }
2465
2468
 
2466
2469
  export declare type MP4RemuxerConfig = {