hls.js 1.6.0-beta.1.0.canary.10752 → 1.6.0-beta.1.0.canary.10754

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
@@ -1057,7 +1057,7 @@
1057
1057
  // Some browsers don't allow to use bind on console object anyway
1058
1058
  // fallback to default if needed
1059
1059
  try {
1060
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.1.0.canary.10752");
1060
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.1.0.canary.10754");
1061
1061
  } catch (e) {
1062
1062
  /* log fn threw an exception. All logger methods are no-ops. */
1063
1063
  return createLogger();
@@ -16222,7 +16222,7 @@
16222
16222
  return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
16223
16223
  }
16224
16224
 
16225
- var version = "1.6.0-beta.1.0.canary.10752";
16225
+ var version = "1.6.0-beta.1.0.canary.10754";
16226
16226
 
16227
16227
  // ensure the worker ends up in the bundle
16228
16228
  // If the worker should not be included this gets aliased to empty.js
@@ -17906,12 +17906,16 @@
17906
17906
  return -1;
17907
17907
  };
17908
17908
  _proto.loadPlaylist = function loadPlaylist(hlsUrlParameters) {
17909
+ var _this$hls$levels$this;
17909
17910
  var audioTrack = this.currentTrack;
17910
- if (this.shouldLoadPlaylist(audioTrack) && audioTrack) {
17911
+ if (!audioTrack) {
17912
+ return;
17913
+ }
17914
+ var url = audioTrack.url;
17915
+ if (this.shouldLoadPlaylist(audioTrack) && url !== ((_this$hls$levels$this = this.hls.levels[this.hls.loadLevel]) == null ? void 0 : _this$hls$levels$this.uri)) {
17911
17916
  _BasePlaylistControll.prototype.loadPlaylist.call(this);
17912
17917
  var id = audioTrack.id;
17913
17918
  var groupId = audioTrack.groupId;
17914
- var url = audioTrack.url;
17915
17919
  if (hlsUrlParameters) {
17916
17920
  try {
17917
17921
  url = hlsUrlParameters.addDirectives(url);
@@ -29895,47 +29899,51 @@
29895
29899
  xhr.onprogress = null;
29896
29900
  var _status = xhr.status;
29897
29901
  // http status between 200 to 299 are all successful
29898
- var useResponse = xhr.responseType !== 'text';
29899
- if (_status >= 200 && _status < 300 && (useResponse && xhr.response || xhr.responseText !== null)) {
29900
- stats.loading.end = Math.max(self.performance.now(), stats.loading.first);
29901
- var data = useResponse ? xhr.response : xhr.responseText;
29902
- var len = xhr.responseType === 'arraybuffer' ? data.byteLength : data.length;
29903
- stats.loaded = stats.total = len;
29904
- stats.bwEstimate = stats.total * 8000 / (stats.loading.end - stats.loading.first);
29905
- if (!this.callbacks) {
29906
- return;
29907
- }
29908
- var onProgress = this.callbacks.onProgress;
29909
- if (onProgress) {
29910
- onProgress(stats, context, data, xhr);
29911
- }
29912
- if (!this.callbacks) {
29902
+ var useResponseText = xhr.responseType === 'text' ? xhr.responseText : null;
29903
+ if (_status >= 200 && _status < 300) {
29904
+ var data = useResponseText != null ? useResponseText : xhr.response;
29905
+ if (data != null) {
29906
+ stats.loading.end = Math.max(self.performance.now(), stats.loading.first);
29907
+ var len = xhr.responseType === 'arraybuffer' ? data.byteLength : data.length;
29908
+ stats.loaded = stats.total = len;
29909
+ stats.bwEstimate = stats.total * 8000 / (stats.loading.end - stats.loading.first);
29910
+ if (!this.callbacks) {
29911
+ return;
29912
+ }
29913
+ var onProgress = this.callbacks.onProgress;
29914
+ if (onProgress) {
29915
+ onProgress(stats, context, data, xhr);
29916
+ }
29917
+ if (!this.callbacks) {
29918
+ return;
29919
+ }
29920
+ var _response = {
29921
+ url: xhr.responseURL,
29922
+ data: data,
29923
+ code: _status
29924
+ };
29925
+ this.callbacks.onSuccess(_response, stats, context, xhr);
29913
29926
  return;
29914
29927
  }
29915
- var response = {
29916
- url: xhr.responseURL,
29917
- data: data,
29918
- code: _status
29919
- };
29920
- this.callbacks.onSuccess(response, stats, context, xhr);
29928
+ }
29929
+
29930
+ // Handle bad status or nullish response
29931
+ var retryConfig = config.loadPolicy.errorRetry;
29932
+ var retryCount = stats.retry;
29933
+ // if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error
29934
+ var response = {
29935
+ url: context.url,
29936
+ data: undefined,
29937
+ code: _status
29938
+ };
29939
+ if (shouldRetry(retryConfig, retryCount, false, response)) {
29940
+ this.retry(retryConfig);
29921
29941
  } else {
29922
- var retryConfig = config.loadPolicy.errorRetry;
29923
- var retryCount = stats.retry;
29924
- // if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error
29925
- var _response = {
29926
- url: context.url,
29927
- data: undefined,
29928
- code: _status
29929
- };
29930
- if (shouldRetry(retryConfig, retryCount, false, _response)) {
29931
- this.retry(retryConfig);
29932
- } else {
29933
- logger.error(_status + " while loading " + context.url);
29934
- this.callbacks.onError({
29935
- code: _status,
29936
- text: xhr.statusText
29937
- }, context, xhr, stats);
29938
- }
29942
+ logger.error(_status + " while loading " + context.url);
29943
+ this.callbacks.onError({
29944
+ code: _status,
29945
+ text: xhr.statusText
29946
+ }, context, xhr, stats);
29939
29947
  }
29940
29948
  }
29941
29949
  }