hls.js 1.5.13-0.canary.10406 → 1.5.13-0.canary.10410

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
@@ -420,7 +420,7 @@ function enableLogs(debugConfig, context, id) {
420
420
  // Some browsers don't allow to use bind on console object anyway
421
421
  // fallback to default if needed
422
422
  try {
423
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.13-0.canary.10406"}`);
423
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.13-0.canary.10410"}`);
424
424
  } catch (e) {
425
425
  /* log fn threw an exception. All logger methods are no-ops. */
426
426
  return createLogger();
@@ -2896,14 +2896,18 @@ function pickMostCompleteCodecName(parsedCodec, levelCodec) {
2896
2896
  }
2897
2897
  function convertAVC1ToAVCOTI(codec) {
2898
2898
  // Convert avc1 codec string from RFC-4281 to RFC-6381 for MediaSource.isTypeSupported
2899
- const avcdata = codec.split('.');
2900
- if (avcdata.length > 2) {
2901
- let result = avcdata.shift() + '.';
2902
- result += parseInt(avcdata.shift()).toString(16);
2903
- result += ('000' + parseInt(avcdata.shift()).toString(16)).slice(-4);
2904
- return result;
2899
+ // Examples: avc1.66.30 to avc1.42001e and avc1.77.30,avc1.66.30 to avc1.4d001e,avc1.42001e.
2900
+ const codecs = codec.split(',');
2901
+ for (let i = 0; i < codecs.length; i++) {
2902
+ const avcdata = codecs[i].split('.');
2903
+ if (avcdata.length > 2) {
2904
+ let result = avcdata.shift() + '.';
2905
+ result += parseInt(avcdata.shift()).toString(16);
2906
+ result += ('000' + parseInt(avcdata.shift()).toString(16)).slice(-4);
2907
+ codecs[i] = result;
2908
+ }
2905
2909
  }
2906
- return codec;
2910
+ return codecs.join(',');
2907
2911
  }
2908
2912
  function getM2TSSupportedAudioTypes(preferManagedMediaSource) {
2909
2913
  const MediaSource = getMediaSource(preferManagedMediaSource) || {
@@ -15740,40 +15744,6 @@ class MP4Remuxer {
15740
15744
  this.isAudioContiguous = true;
15741
15745
  return audioData;
15742
15746
  }
15743
- remuxEmptyAudio(track, timeOffset, contiguous, videoData) {
15744
- const inputTimeScale = track.inputTimeScale;
15745
- const mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale;
15746
- const scaleFactor = inputTimeScale / mp4timeScale;
15747
- const nextAudioPts = this.nextAudioPts;
15748
- // sync with video's timestamp
15749
- const initDTS = this._initDTS;
15750
- const init90kHz = initDTS.baseTime * 90000 / initDTS.timescale;
15751
- const startDTS = (nextAudioPts !== null ? nextAudioPts : videoData.startDTS * inputTimeScale) + init90kHz;
15752
- const endDTS = videoData.endDTS * inputTimeScale + init90kHz;
15753
- // one sample's duration value
15754
- const frameDuration = scaleFactor * AAC_SAMPLES_PER_FRAME;
15755
- // samples count of this segment's duration
15756
- const nbSamples = Math.ceil((endDTS - startDTS) / frameDuration);
15757
- // silent frame
15758
- const silentFrame = AAC.getSilentFrame(track.parsedCodec || track.manifestCodec || track.codec, track.channelCount);
15759
- logger.warn('[mp4-remuxer]: remux empty Audio');
15760
- // Can't remux if we can't generate a silent frame...
15761
- if (!silentFrame) {
15762
- logger.trace('[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec');
15763
- return;
15764
- }
15765
- const samples = [];
15766
- for (let i = 0; i < nbSamples; i++) {
15767
- const stamp = startDTS + i * frameDuration;
15768
- samples.push({
15769
- unit: silentFrame,
15770
- pts: stamp,
15771
- dts: stamp
15772
- });
15773
- }
15774
- track.samples = samples;
15775
- return this.remuxAudio(track, timeOffset, contiguous, false);
15776
- }
15777
15747
  }
15778
15748
  function normalizePts(value, reference) {
15779
15749
  let offset;
@@ -29285,7 +29255,7 @@ class Hls {
29285
29255
  * Get the video-dev/hls.js package version.
29286
29256
  */
29287
29257
  static get version() {
29288
- return "1.5.13-0.canary.10406";
29258
+ return "1.5.13-0.canary.10410";
29289
29259
  }
29290
29260
 
29291
29261
  /**
@@ -29368,7 +29338,7 @@ class Hls {
29368
29338
  this.emeController = void 0;
29369
29339
  this.cmcdController = void 0;
29370
29340
  this._media = null;
29371
- this.url = null;
29341
+ this._url = null;
29372
29342
  this.triggeringException = void 0;
29373
29343
  const logger = this.logger = enableLogs(userConfig.debug || false, 'Hls instance');
29374
29344
  const config = this.config = mergeConfig(Hls.DefaultConfig, userConfig, logger);
@@ -29504,7 +29474,7 @@ class Hls {
29504
29474
  this.detachMedia();
29505
29475
  this.removeAllListeners();
29506
29476
  this._autoLevelCapping = -1;
29507
- this.url = null;
29477
+ this._url = null;
29508
29478
  this.networkControllers.forEach(component => component.destroy());
29509
29479
  this.networkControllers.length = 0;
29510
29480
  this.coreComponents.forEach(component => component.destroy());
@@ -29542,8 +29512,8 @@ class Hls {
29542
29512
  loadSource(url) {
29543
29513
  this.stopLoad();
29544
29514
  const media = this.media;
29545
- const loadedSource = this.url;
29546
- const loadingSource = this.url = urlToolkitExports.buildAbsoluteURL(self.location.href, url, {
29515
+ const loadedSource = this._url;
29516
+ const loadingSource = this._url = urlToolkitExports.buildAbsoluteURL(self.location.href, url, {
29547
29517
  alwaysNormalize: true
29548
29518
  });
29549
29519
  this._autoLevelCapping = -1;
@@ -29559,6 +29529,13 @@ class Hls {
29559
29529
  });
29560
29530
  }
29561
29531
 
29532
+ /**
29533
+ * Gets the currently loaded URL
29534
+ */
29535
+ get url() {
29536
+ return this._url;
29537
+ }
29538
+
29562
29539
  /**
29563
29540
  * Start loading data from the stream source.
29564
29541
  * Depending on default config, client starts loading automatically when a source is set.