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.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 +2 -2
- package/src/controller/audio-track-controller.ts +8 -2
- package/src/utils/xhr-loader.ts +52 -49
package/dist/hls.light.mjs
CHANGED
@@ -400,7 +400,7 @@ function enableLogs(debugConfig, context, id) {
|
|
400
400
|
// Some browsers don't allow to use bind on console object anyway
|
401
401
|
// fallback to default if needed
|
402
402
|
try {
|
403
|
-
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.
|
403
|
+
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.10756"}`);
|
404
404
|
} catch (e) {
|
405
405
|
/* log fn threw an exception. All logger methods are no-ops. */
|
406
406
|
return createLogger();
|
@@ -17005,47 +17005,51 @@ class XhrLoader {
|
|
17005
17005
|
xhr.onprogress = null;
|
17006
17006
|
const status = xhr.status;
|
17007
17007
|
// http status between 200 to 299 are all successful
|
17008
|
-
const
|
17009
|
-
if (status >= 200 && status < 300
|
17010
|
-
|
17011
|
-
|
17012
|
-
|
17013
|
-
|
17014
|
-
|
17015
|
-
|
17016
|
-
|
17017
|
-
|
17018
|
-
|
17019
|
-
|
17020
|
-
onProgress
|
17021
|
-
|
17022
|
-
|
17008
|
+
const useResponseText = xhr.responseType === 'text' ? xhr.responseText : null;
|
17009
|
+
if (status >= 200 && status < 300) {
|
17010
|
+
const data = useResponseText != null ? useResponseText : xhr.response;
|
17011
|
+
if (data != null) {
|
17012
|
+
stats.loading.end = Math.max(self.performance.now(), stats.loading.first);
|
17013
|
+
const len = xhr.responseType === 'arraybuffer' ? data.byteLength : data.length;
|
17014
|
+
stats.loaded = stats.total = len;
|
17015
|
+
stats.bwEstimate = stats.total * 8000 / (stats.loading.end - stats.loading.first);
|
17016
|
+
if (!this.callbacks) {
|
17017
|
+
return;
|
17018
|
+
}
|
17019
|
+
const onProgress = this.callbacks.onProgress;
|
17020
|
+
if (onProgress) {
|
17021
|
+
onProgress(stats, context, data, xhr);
|
17022
|
+
}
|
17023
|
+
if (!this.callbacks) {
|
17024
|
+
return;
|
17025
|
+
}
|
17026
|
+
const _response = {
|
17027
|
+
url: xhr.responseURL,
|
17028
|
+
data: data,
|
17029
|
+
code: status
|
17030
|
+
};
|
17031
|
+
this.callbacks.onSuccess(_response, stats, context, xhr);
|
17023
17032
|
return;
|
17024
17033
|
}
|
17025
|
-
|
17026
|
-
|
17027
|
-
|
17028
|
-
|
17029
|
-
|
17030
|
-
|
17034
|
+
}
|
17035
|
+
|
17036
|
+
// Handle bad status or nullish response
|
17037
|
+
const retryConfig = config.loadPolicy.errorRetry;
|
17038
|
+
const retryCount = stats.retry;
|
17039
|
+
// if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error
|
17040
|
+
const response = {
|
17041
|
+
url: context.url,
|
17042
|
+
data: undefined,
|
17043
|
+
code: status
|
17044
|
+
};
|
17045
|
+
if (shouldRetry(retryConfig, retryCount, false, response)) {
|
17046
|
+
this.retry(retryConfig);
|
17031
17047
|
} else {
|
17032
|
-
|
17033
|
-
|
17034
|
-
|
17035
|
-
|
17036
|
-
|
17037
|
-
data: undefined,
|
17038
|
-
code: status
|
17039
|
-
};
|
17040
|
-
if (shouldRetry(retryConfig, retryCount, false, response)) {
|
17041
|
-
this.retry(retryConfig);
|
17042
|
-
} else {
|
17043
|
-
logger.error(`${status} while loading ${context.url}`);
|
17044
|
-
this.callbacks.onError({
|
17045
|
-
code: status,
|
17046
|
-
text: xhr.statusText
|
17047
|
-
}, context, xhr, stats);
|
17048
|
-
}
|
17048
|
+
logger.error(`${status} while loading ${context.url}`);
|
17049
|
+
this.callbacks.onError({
|
17050
|
+
code: status,
|
17051
|
+
text: xhr.statusText
|
17052
|
+
}, context, xhr, stats);
|
17049
17053
|
}
|
17050
17054
|
}
|
17051
17055
|
}
|
@@ -19083,7 +19087,7 @@ class GapController extends Logger {
|
|
19083
19087
|
}
|
19084
19088
|
}
|
19085
19089
|
|
19086
|
-
const version = "1.6.0-beta.1.0.canary.
|
19090
|
+
const version = "1.6.0-beta.1.0.canary.10756";
|
19087
19091
|
|
19088
19092
|
// ensure the worker ends up in the bundle
|
19089
19093
|
// If the worker should not be included this gets aliased to empty.js
|