hls.js 1.6.3-0.canary.11214 → 1.6.3-0.canary.11216
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 +76 -76
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +2 -2
- 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 +2 -2
- 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 +106 -106
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/dist/hls.worker.js.map +1 -1
- package/package.json +2 -2
package/dist/hls.mjs
CHANGED
@@ -523,7 +523,7 @@ function enableLogs(debugConfig, context, id) {
|
|
523
523
|
// Some browsers don't allow to use bind on console object anyway
|
524
524
|
// fallback to default if needed
|
525
525
|
try {
|
526
|
-
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.3-0.canary.
|
526
|
+
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.3-0.canary.11216"}`);
|
527
527
|
} catch (e) {
|
528
528
|
/* log fn threw an exception. All logger methods are no-ops. */
|
529
529
|
return createLogger();
|
@@ -10237,7 +10237,7 @@ function requireEventemitter3 () {
|
|
10237
10237
|
var eventemitter3Exports = requireEventemitter3();
|
10238
10238
|
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
10239
10239
|
|
10240
|
-
const version = "1.6.3-0.canary.
|
10240
|
+
const version = "1.6.3-0.canary.11216";
|
10241
10241
|
|
10242
10242
|
// ensure the worker ends up in the bundle
|
10243
10243
|
// If the worker should not be included this gets aliased to empty.js
|
@@ -10741,110 +10741,6 @@ function decodeId3UrlFrame(frame) {
|
|
10741
10741
|
};
|
10742
10742
|
}
|
10743
10743
|
|
10744
|
-
/**
|
10745
|
-
* Encodes binary data to base64
|
10746
|
-
*
|
10747
|
-
* @param binary - The binary data to encode
|
10748
|
-
* @returns The base64 encoded string
|
10749
|
-
*
|
10750
|
-
* @group Utils
|
10751
|
-
*
|
10752
|
-
* @beta
|
10753
|
-
*/
|
10754
|
-
function base64encode(binary) {
|
10755
|
-
return btoa(String.fromCharCode(...binary));
|
10756
|
-
}
|
10757
|
-
|
10758
|
-
/**
|
10759
|
-
* This implements the rounding procedure described in step 2 of the "Serializing a Decimal" specification.
|
10760
|
-
* This rounding style is known as "even rounding", "banker's rounding", or "commercial rounding".
|
10761
|
-
*
|
10762
|
-
* @param value - The value to round
|
10763
|
-
* @param precision - The number of decimal places to round to
|
10764
|
-
* @returns The rounded value
|
10765
|
-
*
|
10766
|
-
* @group Utils
|
10767
|
-
*
|
10768
|
-
* @beta
|
10769
|
-
*/
|
10770
|
-
function roundToEven(value, precision) {
|
10771
|
-
if (value < 0) {
|
10772
|
-
return -roundToEven(-value, precision);
|
10773
|
-
}
|
10774
|
-
const decimalShift = Math.pow(10, precision);
|
10775
|
-
const isEquidistant = Math.abs(value * decimalShift % 1 - 0.5) < Number.EPSILON;
|
10776
|
-
if (isEquidistant) {
|
10777
|
-
// If the tail of the decimal place is 'equidistant' we round to the nearest even value
|
10778
|
-
const flooredValue = Math.floor(value * decimalShift);
|
10779
|
-
return (flooredValue % 2 === 0 ? flooredValue : flooredValue + 1) / decimalShift;
|
10780
|
-
} else {
|
10781
|
-
// Otherwise, proceed as normal
|
10782
|
-
return Math.round(value * decimalShift) / decimalShift;
|
10783
|
-
}
|
10784
|
-
}
|
10785
|
-
|
10786
|
-
/**
|
10787
|
-
* Constructs a relative path from a URL.
|
10788
|
-
*
|
10789
|
-
* @param url - The destination URL
|
10790
|
-
* @param base - The base URL
|
10791
|
-
* @returns The relative path
|
10792
|
-
*
|
10793
|
-
* @group Utils
|
10794
|
-
*
|
10795
|
-
* @beta
|
10796
|
-
*/
|
10797
|
-
function urlToRelativePath(url, base) {
|
10798
|
-
const to = new URL(url);
|
10799
|
-
const from = new URL(base);
|
10800
|
-
if (to.origin !== from.origin) {
|
10801
|
-
return url;
|
10802
|
-
}
|
10803
|
-
const toPath = to.pathname.split('/').slice(1);
|
10804
|
-
const fromPath = from.pathname.split('/').slice(1, -1);
|
10805
|
-
// remove common parents
|
10806
|
-
while (toPath[0] === fromPath[0]) {
|
10807
|
-
toPath.shift();
|
10808
|
-
fromPath.shift();
|
10809
|
-
}
|
10810
|
-
// add back paths
|
10811
|
-
while (fromPath.length) {
|
10812
|
-
fromPath.shift();
|
10813
|
-
toPath.unshift('..');
|
10814
|
-
}
|
10815
|
-
return toPath.join('/');
|
10816
|
-
}
|
10817
|
-
|
10818
|
-
/**
|
10819
|
-
* Generate a random v4 UUID
|
10820
|
-
*
|
10821
|
-
* @returns A random v4 UUID
|
10822
|
-
*
|
10823
|
-
* @group Utils
|
10824
|
-
*
|
10825
|
-
* @beta
|
10826
|
-
*/
|
10827
|
-
function uuid() {
|
10828
|
-
try {
|
10829
|
-
return crypto.randomUUID();
|
10830
|
-
} catch (error) {
|
10831
|
-
try {
|
10832
|
-
const url = URL.createObjectURL(new Blob());
|
10833
|
-
const uuid = url.toString();
|
10834
|
-
URL.revokeObjectURL(url);
|
10835
|
-
return uuid.slice(uuid.lastIndexOf('/') + 1);
|
10836
|
-
} catch (error) {
|
10837
|
-
let dt = new Date().getTime();
|
10838
|
-
const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
|
10839
|
-
const r = (dt + Math.random() * 16) % 16 | 0;
|
10840
|
-
dt = Math.floor(dt / 16);
|
10841
|
-
return (c == 'x' ? r : r & 0x3 | 0x8).toString(16);
|
10842
|
-
});
|
10843
|
-
return uuid;
|
10844
|
-
}
|
10845
|
-
}
|
10846
|
-
}
|
10847
|
-
|
10848
10744
|
function toArrayBuffer(view) {
|
10849
10745
|
if (view instanceof ArrayBuffer) {
|
10850
10746
|
return view;
|
@@ -20107,6 +20003,20 @@ function serializeBoolean(value) {
|
|
20107
20003
|
return value ? '?1' : '?0';
|
20108
20004
|
}
|
20109
20005
|
|
20006
|
+
/**
|
20007
|
+
* Encodes binary data to base64
|
20008
|
+
*
|
20009
|
+
* @param binary - The binary data to encode
|
20010
|
+
* @returns The base64 encoded string
|
20011
|
+
*
|
20012
|
+
* @group Utils
|
20013
|
+
*
|
20014
|
+
* @beta
|
20015
|
+
*/
|
20016
|
+
function base64encode(binary) {
|
20017
|
+
return btoa(String.fromCharCode(...binary));
|
20018
|
+
}
|
20019
|
+
|
20110
20020
|
const BYTES = 'Byte Sequence';
|
20111
20021
|
|
20112
20022
|
// 4.1.8. Serializing a Byte Sequence
|
@@ -20183,6 +20093,34 @@ function serializeDate(value) {
|
|
20183
20093
|
return `@${serializeInteger(value.getTime() / 1000)}`;
|
20184
20094
|
}
|
20185
20095
|
|
20096
|
+
/**
|
20097
|
+
* This implements the rounding procedure described in step 2 of the "Serializing a Decimal" specification.
|
20098
|
+
* This rounding style is known as "even rounding", "banker's rounding", or "commercial rounding".
|
20099
|
+
*
|
20100
|
+
* @param value - The value to round
|
20101
|
+
* @param precision - The number of decimal places to round to
|
20102
|
+
* @returns The rounded value
|
20103
|
+
*
|
20104
|
+
* @group Utils
|
20105
|
+
*
|
20106
|
+
* @beta
|
20107
|
+
*/
|
20108
|
+
function roundToEven(value, precision) {
|
20109
|
+
if (value < 0) {
|
20110
|
+
return -roundToEven(-value, precision);
|
20111
|
+
}
|
20112
|
+
const decimalShift = Math.pow(10, precision);
|
20113
|
+
const isEquidistant = Math.abs(value * decimalShift % 1 - 0.5) < Number.EPSILON;
|
20114
|
+
if (isEquidistant) {
|
20115
|
+
// If the tail of the decimal place is 'equidistant' we round to the nearest even value
|
20116
|
+
const flooredValue = Math.floor(value * decimalShift);
|
20117
|
+
return (flooredValue % 2 === 0 ? flooredValue : flooredValue + 1) / decimalShift;
|
20118
|
+
} else {
|
20119
|
+
// Otherwise, proceed as normal
|
20120
|
+
return Math.round(value * decimalShift) / decimalShift;
|
20121
|
+
}
|
20122
|
+
}
|
20123
|
+
|
20186
20124
|
const DECIMAL = 'Decimal';
|
20187
20125
|
|
20188
20126
|
// 4.1.5. Serializing a Decimal
|
@@ -20567,6 +20505,38 @@ function isValid(value) {
|
|
20567
20505
|
return value != null && value !== '' && value !== false;
|
20568
20506
|
}
|
20569
20507
|
|
20508
|
+
/**
|
20509
|
+
* Constructs a relative path from a URL.
|
20510
|
+
*
|
20511
|
+
* @param url - The destination URL
|
20512
|
+
* @param base - The base URL
|
20513
|
+
* @returns The relative path
|
20514
|
+
*
|
20515
|
+
* @group Utils
|
20516
|
+
*
|
20517
|
+
* @beta
|
20518
|
+
*/
|
20519
|
+
function urlToRelativePath(url, base) {
|
20520
|
+
const to = new URL(url);
|
20521
|
+
const from = new URL(base);
|
20522
|
+
if (to.origin !== from.origin) {
|
20523
|
+
return url;
|
20524
|
+
}
|
20525
|
+
const toPath = to.pathname.split('/').slice(1);
|
20526
|
+
const fromPath = from.pathname.split('/').slice(1, -1);
|
20527
|
+
// remove common parents
|
20528
|
+
while (toPath[0] === fromPath[0]) {
|
20529
|
+
toPath.shift();
|
20530
|
+
fromPath.shift();
|
20531
|
+
}
|
20532
|
+
// add back paths
|
20533
|
+
while (fromPath.length) {
|
20534
|
+
fromPath.shift();
|
20535
|
+
toPath.unshift('..');
|
20536
|
+
}
|
20537
|
+
return toPath.join('/');
|
20538
|
+
}
|
20539
|
+
|
20570
20540
|
const toRounded = value => Math.round(value);
|
20571
20541
|
const toUrlSafe = (value, options) => {
|
20572
20542
|
if (options === null || options === void 0 ? void 0 : options.baseUrl) {
|
@@ -23206,6 +23176,36 @@ class SubtitleTrackController extends BasePlaylistController {
|
|
23206
23176
|
}
|
23207
23177
|
}
|
23208
23178
|
|
23179
|
+
/**
|
23180
|
+
* Generate a random v4 UUID
|
23181
|
+
*
|
23182
|
+
* @returns A random v4 UUID
|
23183
|
+
*
|
23184
|
+
* @group Utils
|
23185
|
+
*
|
23186
|
+
* @beta
|
23187
|
+
*/
|
23188
|
+
function uuid() {
|
23189
|
+
try {
|
23190
|
+
return crypto.randomUUID();
|
23191
|
+
} catch (error) {
|
23192
|
+
try {
|
23193
|
+
const url = URL.createObjectURL(new Blob());
|
23194
|
+
const uuid = url.toString();
|
23195
|
+
URL.revokeObjectURL(url);
|
23196
|
+
return uuid.slice(uuid.lastIndexOf('/') + 1);
|
23197
|
+
} catch (error) {
|
23198
|
+
let dt = new Date().getTime();
|
23199
|
+
const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
|
23200
|
+
const r = (dt + Math.random() * 16) % 16 | 0;
|
23201
|
+
dt = Math.floor(dt / 16);
|
23202
|
+
return (c == 'x' ? r : r & 0x3 | 0x8).toString(16);
|
23203
|
+
});
|
23204
|
+
return uuid;
|
23205
|
+
}
|
23206
|
+
}
|
23207
|
+
}
|
23208
|
+
|
23209
23209
|
// From https://github.com/darkskyapp/string-hash
|
23210
23210
|
function hash(text) {
|
23211
23211
|
let hash = 5381;
|