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.light.js CHANGED
@@ -493,7 +493,7 @@
493
493
  // Some browsers don't allow to use bind on console object anyway
494
494
  // fallback to default if needed
495
495
  try {
496
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.13-0.canary.10406");
496
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.13-0.canary.10410");
497
497
  } catch (e) {
498
498
  /* log fn threw an exception. All logger methods are no-ops. */
499
499
  return createLogger();
@@ -2685,14 +2685,18 @@
2685
2685
  }
2686
2686
  function convertAVC1ToAVCOTI(codec) {
2687
2687
  // Convert avc1 codec string from RFC-4281 to RFC-6381 for MediaSource.isTypeSupported
2688
- var avcdata = codec.split('.');
2689
- if (avcdata.length > 2) {
2690
- var result = avcdata.shift() + '.';
2691
- result += parseInt(avcdata.shift()).toString(16);
2692
- result += ('000' + parseInt(avcdata.shift()).toString(16)).slice(-4);
2693
- return result;
2694
- }
2695
- return codec;
2688
+ // Examples: avc1.66.30 to avc1.42001e and avc1.77.30,avc1.66.30 to avc1.4d001e,avc1.42001e.
2689
+ var codecs = codec.split(',');
2690
+ for (var i = 0; i < codecs.length; i++) {
2691
+ var avcdata = codecs[i].split('.');
2692
+ if (avcdata.length > 2) {
2693
+ var result = avcdata.shift() + '.';
2694
+ result += parseInt(avcdata.shift()).toString(16);
2695
+ result += ('000' + parseInt(avcdata.shift()).toString(16)).slice(-4);
2696
+ codecs[i] = result;
2697
+ }
2698
+ }
2699
+ return codecs.join(',');
2696
2700
  }
2697
2701
  function getM2TSSupportedAudioTypes(preferManagedMediaSource) {
2698
2702
  var MediaSource = getMediaSource(preferManagedMediaSource) || {
@@ -18160,40 +18164,6 @@
18160
18164
  this.isAudioContiguous = true;
18161
18165
  return audioData;
18162
18166
  };
18163
- _proto.remuxEmptyAudio = function remuxEmptyAudio(track, timeOffset, contiguous, videoData) {
18164
- var inputTimeScale = track.inputTimeScale;
18165
- var mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale;
18166
- var scaleFactor = inputTimeScale / mp4timeScale;
18167
- var nextAudioPts = this.nextAudioPts;
18168
- // sync with video's timestamp
18169
- var initDTS = this._initDTS;
18170
- var init90kHz = initDTS.baseTime * 90000 / initDTS.timescale;
18171
- var startDTS = (nextAudioPts !== null ? nextAudioPts : videoData.startDTS * inputTimeScale) + init90kHz;
18172
- var endDTS = videoData.endDTS * inputTimeScale + init90kHz;
18173
- // one sample's duration value
18174
- var frameDuration = scaleFactor * AAC_SAMPLES_PER_FRAME;
18175
- // samples count of this segment's duration
18176
- var nbSamples = Math.ceil((endDTS - startDTS) / frameDuration);
18177
- // silent frame
18178
- var silentFrame = AAC.getSilentFrame(track.parsedCodec || track.manifestCodec || track.codec, track.channelCount);
18179
- logger.warn('[mp4-remuxer]: remux empty Audio');
18180
- // Can't remux if we can't generate a silent frame...
18181
- if (!silentFrame) {
18182
- logger.trace('[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec');
18183
- return;
18184
- }
18185
- var samples = [];
18186
- for (var i = 0; i < nbSamples; i++) {
18187
- var stamp = startDTS + i * frameDuration;
18188
- samples.push({
18189
- unit: silentFrame,
18190
- pts: stamp,
18191
- dts: stamp
18192
- });
18193
- }
18194
- track.samples = samples;
18195
- return this.remuxAudio(track, timeOffset, contiguous, false);
18196
- };
18197
18167
  return MP4Remuxer;
18198
18168
  }();
18199
18169
  function normalizePts(value, reference) {
@@ -21164,7 +21134,7 @@
21164
21134
  this.emeController = void 0;
21165
21135
  this.cmcdController = void 0;
21166
21136
  this._media = null;
21167
- this.url = null;
21137
+ this._url = null;
21168
21138
  this.triggeringException = void 0;
21169
21139
  var logger = this.logger = enableLogs(userConfig.debug || false, 'Hls instance');
21170
21140
  var config = this.config = mergeConfig(Hls.DefaultConfig, userConfig, logger);
@@ -21329,7 +21299,7 @@
21329
21299
  this.detachMedia();
21330
21300
  this.removeAllListeners();
21331
21301
  this._autoLevelCapping = -1;
21332
- this.url = null;
21302
+ this._url = null;
21333
21303
  this.networkControllers.forEach(function (component) {
21334
21304
  return component.destroy();
21335
21305
  });
@@ -21371,8 +21341,8 @@
21371
21341
  _proto.loadSource = function loadSource(url) {
21372
21342
  this.stopLoad();
21373
21343
  var media = this.media;
21374
- var loadedSource = this.url;
21375
- var loadingSource = this.url = urlToolkitExports.buildAbsoluteURL(self.location.href, url, {
21344
+ var loadedSource = this._url;
21345
+ var loadingSource = this._url = urlToolkitExports.buildAbsoluteURL(self.location.href, url, {
21376
21346
  alwaysNormalize: true
21377
21347
  });
21378
21348
  this._autoLevelCapping = -1;
@@ -21388,13 +21358,16 @@
21388
21358
  });
21389
21359
  }
21390
21360
 
21361
+ /**
21362
+ * Gets the currently loaded URL
21363
+ */;
21391
21364
  /**
21392
21365
  * Start loading data from the stream source.
21393
21366
  * Depending on default config, client starts loading automatically when a source is set.
21394
21367
  *
21395
21368
  * @param startPosition - Set the start position to stream from.
21396
21369
  * Defaults to -1 (None: starts from earliest point)
21397
- */;
21370
+ */
21398
21371
  _proto.startLoad = function startLoad(startPosition) {
21399
21372
  if (startPosition === void 0) {
21400
21373
  startPosition = -1;
@@ -21488,6 +21461,11 @@
21488
21461
  * Get the complete list of audio tracks across all media groups
21489
21462
  */;
21490
21463
  return _createClass(Hls, [{
21464
+ key: "url",
21465
+ get: function get() {
21466
+ return this._url;
21467
+ }
21468
+ }, {
21491
21469
  key: "levels",
21492
21470
  get: function get() {
21493
21471
  var levels = this.levelController.levels;
@@ -22009,7 +21987,7 @@
22009
21987
  * Get the video-dev/hls.js package version.
22010
21988
  */
22011
21989
  function get() {
22012
- return "1.5.13-0.canary.10406";
21990
+ return "1.5.13-0.canary.10410";
22013
21991
  }
22014
21992
  }, {
22015
21993
  key: "Events",