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.js CHANGED
@@ -522,7 +522,7 @@
522
522
  // Some browsers don't allow to use bind on console object anyway
523
523
  // fallback to default if needed
524
524
  try {
525
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.13-0.canary.10406");
525
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.13-0.canary.10410");
526
526
  } catch (e) {
527
527
  /* log fn threw an exception. All logger methods are no-ops. */
528
528
  return createLogger();
@@ -3116,14 +3116,18 @@
3116
3116
  }
3117
3117
  function convertAVC1ToAVCOTI(codec) {
3118
3118
  // Convert avc1 codec string from RFC-4281 to RFC-6381 for MediaSource.isTypeSupported
3119
- var avcdata = codec.split('.');
3120
- if (avcdata.length > 2) {
3121
- var result = avcdata.shift() + '.';
3122
- result += parseInt(avcdata.shift()).toString(16);
3123
- result += ('000' + parseInt(avcdata.shift()).toString(16)).slice(-4);
3124
- return result;
3119
+ // Examples: avc1.66.30 to avc1.42001e and avc1.77.30,avc1.66.30 to avc1.4d001e,avc1.42001e.
3120
+ var codecs = codec.split(',');
3121
+ for (var i = 0; i < codecs.length; i++) {
3122
+ var avcdata = codecs[i].split('.');
3123
+ if (avcdata.length > 2) {
3124
+ var result = avcdata.shift() + '.';
3125
+ result += parseInt(avcdata.shift()).toString(16);
3126
+ result += ('000' + parseInt(avcdata.shift()).toString(16)).slice(-4);
3127
+ codecs[i] = result;
3128
+ }
3125
3129
  }
3126
- return codec;
3130
+ return codecs.join(',');
3127
3131
  }
3128
3132
  function getM2TSSupportedAudioTypes(preferManagedMediaSource) {
3129
3133
  var MediaSource = getMediaSource(preferManagedMediaSource) || {
@@ -16135,40 +16139,6 @@
16135
16139
  this.isAudioContiguous = true;
16136
16140
  return audioData;
16137
16141
  };
16138
- _proto.remuxEmptyAudio = function remuxEmptyAudio(track, timeOffset, contiguous, videoData) {
16139
- var inputTimeScale = track.inputTimeScale;
16140
- var mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale;
16141
- var scaleFactor = inputTimeScale / mp4timeScale;
16142
- var nextAudioPts = this.nextAudioPts;
16143
- // sync with video's timestamp
16144
- var initDTS = this._initDTS;
16145
- var init90kHz = initDTS.baseTime * 90000 / initDTS.timescale;
16146
- var startDTS = (nextAudioPts !== null ? nextAudioPts : videoData.startDTS * inputTimeScale) + init90kHz;
16147
- var endDTS = videoData.endDTS * inputTimeScale + init90kHz;
16148
- // one sample's duration value
16149
- var frameDuration = scaleFactor * AAC_SAMPLES_PER_FRAME;
16150
- // samples count of this segment's duration
16151
- var nbSamples = Math.ceil((endDTS - startDTS) / frameDuration);
16152
- // silent frame
16153
- var silentFrame = AAC.getSilentFrame(track.parsedCodec || track.manifestCodec || track.codec, track.channelCount);
16154
- logger.warn('[mp4-remuxer]: remux empty Audio');
16155
- // Can't remux if we can't generate a silent frame...
16156
- if (!silentFrame) {
16157
- logger.trace('[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec');
16158
- return;
16159
- }
16160
- var samples = [];
16161
- for (var i = 0; i < nbSamples; i++) {
16162
- var stamp = startDTS + i * frameDuration;
16163
- samples.push({
16164
- unit: silentFrame,
16165
- pts: stamp,
16166
- dts: stamp
16167
- });
16168
- }
16169
- track.samples = samples;
16170
- return this.remuxAudio(track, timeOffset, contiguous, false);
16171
- };
16172
16142
  return MP4Remuxer;
16173
16143
  }();
16174
16144
  function normalizePts(value, reference) {
@@ -29952,7 +29922,7 @@
29952
29922
  this.emeController = void 0;
29953
29923
  this.cmcdController = void 0;
29954
29924
  this._media = null;
29955
- this.url = null;
29925
+ this._url = null;
29956
29926
  this.triggeringException = void 0;
29957
29927
  var logger = this.logger = enableLogs(userConfig.debug || false, 'Hls instance');
29958
29928
  var config = this.config = mergeConfig(Hls.DefaultConfig, userConfig, logger);
@@ -30117,7 +30087,7 @@
30117
30087
  this.detachMedia();
30118
30088
  this.removeAllListeners();
30119
30089
  this._autoLevelCapping = -1;
30120
- this.url = null;
30090
+ this._url = null;
30121
30091
  this.networkControllers.forEach(function (component) {
30122
30092
  return component.destroy();
30123
30093
  });
@@ -30159,8 +30129,8 @@
30159
30129
  _proto.loadSource = function loadSource(url) {
30160
30130
  this.stopLoad();
30161
30131
  var media = this.media;
30162
- var loadedSource = this.url;
30163
- var loadingSource = this.url = urlToolkitExports.buildAbsoluteURL(self.location.href, url, {
30132
+ var loadedSource = this._url;
30133
+ var loadingSource = this._url = urlToolkitExports.buildAbsoluteURL(self.location.href, url, {
30164
30134
  alwaysNormalize: true
30165
30135
  });
30166
30136
  this._autoLevelCapping = -1;
@@ -30176,13 +30146,16 @@
30176
30146
  });
30177
30147
  }
30178
30148
 
30149
+ /**
30150
+ * Gets the currently loaded URL
30151
+ */;
30179
30152
  /**
30180
30153
  * Start loading data from the stream source.
30181
30154
  * Depending on default config, client starts loading automatically when a source is set.
30182
30155
  *
30183
30156
  * @param startPosition - Set the start position to stream from.
30184
30157
  * Defaults to -1 (None: starts from earliest point)
30185
- */;
30158
+ */
30186
30159
  _proto.startLoad = function startLoad(startPosition) {
30187
30160
  if (startPosition === void 0) {
30188
30161
  startPosition = -1;
@@ -30276,6 +30249,11 @@
30276
30249
  * Get the complete list of audio tracks across all media groups
30277
30250
  */;
30278
30251
  return _createClass(Hls, [{
30252
+ key: "url",
30253
+ get: function get() {
30254
+ return this._url;
30255
+ }
30256
+ }, {
30279
30257
  key: "levels",
30280
30258
  get: function get() {
30281
30259
  var levels = this.levelController.levels;
@@ -30797,7 +30775,7 @@
30797
30775
  * Get the video-dev/hls.js package version.
30798
30776
  */
30799
30777
  function get() {
30800
- return "1.5.13-0.canary.10406";
30778
+ return "1.5.13-0.canary.10410";
30801
30779
  }
30802
30780
  }, {
30803
30781
  key: "Events",
package/dist/hls.js.d.ts CHANGED
@@ -1372,7 +1372,7 @@ declare class Hls implements HlsEventEmitter {
1372
1372
  private emeController;
1373
1373
  private cmcdController;
1374
1374
  private _media;
1375
- private url;
1375
+ private _url;
1376
1376
  private triggeringException?;
1377
1377
  /**
1378
1378
  * Get the video-dev/hls.js package version.
@@ -1431,6 +1431,10 @@ declare class Hls implements HlsEventEmitter {
1431
1431
  * Set the source URL. Can be relative or absolute.
1432
1432
  */
1433
1433
  loadSource(url: string): void;
1434
+ /**
1435
+ * Gets the currently loaded URL
1436
+ */
1437
+ get url(): string | null;
1434
1438
  /**
1435
1439
  * Start loading data from the stream source.
1436
1440
  * Depending on default config, client starts loading automatically when a source is set.