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.
@@ -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();
@@ -2507,14 +2507,18 @@ function pickMostCompleteCodecName(parsedCodec, levelCodec) {
2507
2507
  }
2508
2508
  function convertAVC1ToAVCOTI(codec) {
2509
2509
  // Convert avc1 codec string from RFC-4281 to RFC-6381 for MediaSource.isTypeSupported
2510
- const avcdata = codec.split('.');
2511
- if (avcdata.length > 2) {
2512
- let result = avcdata.shift() + '.';
2513
- result += parseInt(avcdata.shift()).toString(16);
2514
- result += ('000' + parseInt(avcdata.shift()).toString(16)).slice(-4);
2515
- return result;
2510
+ // Examples: avc1.66.30 to avc1.42001e and avc1.77.30,avc1.66.30 to avc1.4d001e,avc1.42001e.
2511
+ const codecs = codec.split(',');
2512
+ for (let i = 0; i < codecs.length; i++) {
2513
+ const avcdata = codecs[i].split('.');
2514
+ if (avcdata.length > 2) {
2515
+ let result = avcdata.shift() + '.';
2516
+ result += parseInt(avcdata.shift()).toString(16);
2517
+ result += ('000' + parseInt(avcdata.shift()).toString(16)).slice(-4);
2518
+ codecs[i] = result;
2519
+ }
2516
2520
  }
2517
- return codec;
2521
+ return codecs.join(',');
2518
2522
  }
2519
2523
  function getM2TSSupportedAudioTypes(preferManagedMediaSource) {
2520
2524
  const MediaSource = getMediaSource(preferManagedMediaSource) || {
@@ -17811,40 +17815,6 @@ class MP4Remuxer {
17811
17815
  this.isAudioContiguous = true;
17812
17816
  return audioData;
17813
17817
  }
17814
- remuxEmptyAudio(track, timeOffset, contiguous, videoData) {
17815
- const inputTimeScale = track.inputTimeScale;
17816
- const mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale;
17817
- const scaleFactor = inputTimeScale / mp4timeScale;
17818
- const nextAudioPts = this.nextAudioPts;
17819
- // sync with video's timestamp
17820
- const initDTS = this._initDTS;
17821
- const init90kHz = initDTS.baseTime * 90000 / initDTS.timescale;
17822
- const startDTS = (nextAudioPts !== null ? nextAudioPts : videoData.startDTS * inputTimeScale) + init90kHz;
17823
- const endDTS = videoData.endDTS * inputTimeScale + init90kHz;
17824
- // one sample's duration value
17825
- const frameDuration = scaleFactor * AAC_SAMPLES_PER_FRAME;
17826
- // samples count of this segment's duration
17827
- const nbSamples = Math.ceil((endDTS - startDTS) / frameDuration);
17828
- // silent frame
17829
- const silentFrame = AAC.getSilentFrame(track.parsedCodec || track.manifestCodec || track.codec, track.channelCount);
17830
- logger.warn('[mp4-remuxer]: remux empty Audio');
17831
- // Can't remux if we can't generate a silent frame...
17832
- if (!silentFrame) {
17833
- logger.trace('[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec');
17834
- return;
17835
- }
17836
- const samples = [];
17837
- for (let i = 0; i < nbSamples; i++) {
17838
- const stamp = startDTS + i * frameDuration;
17839
- samples.push({
17840
- unit: silentFrame,
17841
- pts: stamp,
17842
- dts: stamp
17843
- });
17844
- }
17845
- track.samples = samples;
17846
- return this.remuxAudio(track, timeOffset, contiguous, false);
17847
- }
17848
17818
  }
17849
17819
  function normalizePts(value, reference) {
17850
17820
  let offset;
@@ -20670,7 +20640,7 @@ class Hls {
20670
20640
  * Get the video-dev/hls.js package version.
20671
20641
  */
20672
20642
  static get version() {
20673
- return "1.5.13-0.canary.10406";
20643
+ return "1.5.13-0.canary.10410";
20674
20644
  }
20675
20645
 
20676
20646
  /**
@@ -20753,7 +20723,7 @@ class Hls {
20753
20723
  this.emeController = void 0;
20754
20724
  this.cmcdController = void 0;
20755
20725
  this._media = null;
20756
- this.url = null;
20726
+ this._url = null;
20757
20727
  this.triggeringException = void 0;
20758
20728
  const logger = this.logger = enableLogs(userConfig.debug || false, 'Hls instance');
20759
20729
  const config = this.config = mergeConfig(Hls.DefaultConfig, userConfig, logger);
@@ -20889,7 +20859,7 @@ class Hls {
20889
20859
  this.detachMedia();
20890
20860
  this.removeAllListeners();
20891
20861
  this._autoLevelCapping = -1;
20892
- this.url = null;
20862
+ this._url = null;
20893
20863
  this.networkControllers.forEach(component => component.destroy());
20894
20864
  this.networkControllers.length = 0;
20895
20865
  this.coreComponents.forEach(component => component.destroy());
@@ -20927,8 +20897,8 @@ class Hls {
20927
20897
  loadSource(url) {
20928
20898
  this.stopLoad();
20929
20899
  const media = this.media;
20930
- const loadedSource = this.url;
20931
- const loadingSource = this.url = urlToolkitExports.buildAbsoluteURL(self.location.href, url, {
20900
+ const loadedSource = this._url;
20901
+ const loadingSource = this._url = urlToolkitExports.buildAbsoluteURL(self.location.href, url, {
20932
20902
  alwaysNormalize: true
20933
20903
  });
20934
20904
  this._autoLevelCapping = -1;
@@ -20944,6 +20914,13 @@ class Hls {
20944
20914
  });
20945
20915
  }
20946
20916
 
20917
+ /**
20918
+ * Gets the currently loaded URL
20919
+ */
20920
+ get url() {
20921
+ return this._url;
20922
+ }
20923
+
20947
20924
  /**
20948
20925
  * Start loading data from the stream source.
20949
20926
  * Depending on default config, client starts loading automatically when a source is set.