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

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
@@ -1028,7 +1028,7 @@
1028
1028
  // Some browsers don't allow to use bind on console object anyway
1029
1029
  // fallback to default if needed
1030
1030
  try {
1031
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.1.0.canary.10752");
1031
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.1.0.canary.10756");
1032
1032
  } catch (e) {
1033
1033
  /* log fn threw an exception. All logger methods are no-ops. */
1034
1034
  return createLogger();
@@ -14720,47 +14720,51 @@
14720
14720
  xhr.onprogress = null;
14721
14721
  var _status = xhr.status;
14722
14722
  // http status between 200 to 299 are all successful
14723
- var useResponse = xhr.responseType !== 'text';
14724
- if (_status >= 200 && _status < 300 && (useResponse && xhr.response || xhr.responseText !== null)) {
14725
- stats.loading.end = Math.max(self.performance.now(), stats.loading.first);
14726
- var data = useResponse ? xhr.response : xhr.responseText;
14727
- var len = xhr.responseType === 'arraybuffer' ? data.byteLength : data.length;
14728
- stats.loaded = stats.total = len;
14729
- stats.bwEstimate = stats.total * 8000 / (stats.loading.end - stats.loading.first);
14730
- if (!this.callbacks) {
14731
- return;
14732
- }
14733
- var onProgress = this.callbacks.onProgress;
14734
- if (onProgress) {
14735
- onProgress(stats, context, data, xhr);
14736
- }
14737
- if (!this.callbacks) {
14723
+ var useResponseText = xhr.responseType === 'text' ? xhr.responseText : null;
14724
+ if (_status >= 200 && _status < 300) {
14725
+ var data = useResponseText != null ? useResponseText : xhr.response;
14726
+ if (data != null) {
14727
+ stats.loading.end = Math.max(self.performance.now(), stats.loading.first);
14728
+ var len = xhr.responseType === 'arraybuffer' ? data.byteLength : data.length;
14729
+ stats.loaded = stats.total = len;
14730
+ stats.bwEstimate = stats.total * 8000 / (stats.loading.end - stats.loading.first);
14731
+ if (!this.callbacks) {
14732
+ return;
14733
+ }
14734
+ var onProgress = this.callbacks.onProgress;
14735
+ if (onProgress) {
14736
+ onProgress(stats, context, data, xhr);
14737
+ }
14738
+ if (!this.callbacks) {
14739
+ return;
14740
+ }
14741
+ var _response = {
14742
+ url: xhr.responseURL,
14743
+ data: data,
14744
+ code: _status
14745
+ };
14746
+ this.callbacks.onSuccess(_response, stats, context, xhr);
14738
14747
  return;
14739
14748
  }
14740
- var response = {
14741
- url: xhr.responseURL,
14742
- data: data,
14743
- code: _status
14744
- };
14745
- this.callbacks.onSuccess(response, stats, context, xhr);
14749
+ }
14750
+
14751
+ // Handle bad status or nullish response
14752
+ var retryConfig = config.loadPolicy.errorRetry;
14753
+ var retryCount = stats.retry;
14754
+ // if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error
14755
+ var response = {
14756
+ url: context.url,
14757
+ data: undefined,
14758
+ code: _status
14759
+ };
14760
+ if (shouldRetry(retryConfig, retryCount, false, response)) {
14761
+ this.retry(retryConfig);
14746
14762
  } else {
14747
- var retryConfig = config.loadPolicy.errorRetry;
14748
- var retryCount = stats.retry;
14749
- // if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error
14750
- var _response = {
14751
- url: context.url,
14752
- data: undefined,
14753
- code: _status
14754
- };
14755
- if (shouldRetry(retryConfig, retryCount, false, _response)) {
14756
- this.retry(retryConfig);
14757
- } else {
14758
- logger.error(_status + " while loading " + context.url);
14759
- this.callbacks.onError({
14760
- code: _status,
14761
- text: xhr.statusText
14762
- }, context, xhr, stats);
14763
- }
14763
+ logger.error(_status + " while loading " + context.url);
14764
+ this.callbacks.onError({
14765
+ code: _status,
14766
+ text: xhr.statusText
14767
+ }, context, xhr, stats);
14764
14768
  }
14765
14769
  }
14766
14770
  }
@@ -19693,7 +19697,7 @@
19693
19697
  return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
19694
19698
  }
19695
19699
 
19696
- var version = "1.6.0-beta.1.0.canary.10752";
19700
+ var version = "1.6.0-beta.1.0.canary.10756";
19697
19701
 
19698
19702
  // ensure the worker ends up in the bundle
19699
19703
  // If the worker should not be included this gets aliased to empty.js