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 +50 -42
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +44 -40
- package/dist/hls.light.js.map +1 -1
- package/dist/hls.light.min.js +1 -1
- package/dist/hls.light.min.js.map +1 -1
- package/dist/hls.light.mjs +44 -40
- package/dist/hls.light.mjs.map +1 -1
- package/dist/hls.min.js +1 -1
- package/dist/hls.min.js.map +1 -1
- package/dist/hls.mjs +50 -42
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/package.json +1 -1
- package/src/controller/audio-track-controller.ts +8 -2
- package/src/utils/xhr-loader.ts +52 -49
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.
|
1031
|
+
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.1.0.canary.10754");
|
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
|
14724
|
-
if (_status >= 200 && _status < 300
|
14725
|
-
|
14726
|
-
|
14727
|
-
|
14728
|
-
|
14729
|
-
|
14730
|
-
|
14731
|
-
|
14732
|
-
|
14733
|
-
|
14734
|
-
|
14735
|
-
onProgress
|
14736
|
-
|
14737
|
-
|
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
|
-
|
14741
|
-
|
14742
|
-
|
14743
|
-
|
14744
|
-
|
14745
|
-
|
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
|
-
|
14748
|
-
|
14749
|
-
|
14750
|
-
|
14751
|
-
|
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.
|
19700
|
+
var version = "1.6.0-beta.1.0.canary.10754";
|
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
|