hls.js 1.6.3-0.canary.11214 → 1.6.3-0.canary.11218
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 +167 -167
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +93 -93
- 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 +87 -87
- 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 +191 -191
- 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.js
CHANGED
@@ -1165,7 +1165,7 @@
|
|
1165
1165
|
// Some browsers don't allow to use bind on console object anyway
|
1166
1166
|
// fallback to default if needed
|
1167
1167
|
try {
|
1168
|
-
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.3-0.canary.
|
1168
|
+
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.3-0.canary.11218");
|
1169
1169
|
} catch (e) {
|
1170
1170
|
/* log fn threw an exception. All logger methods are no-ops. */
|
1171
1171
|
return createLogger();
|
@@ -10951,6 +10951,97 @@
|
|
10951
10951
|
return isId3Header(data, offset) && readId3Size(data, offset + 6) + 10 <= data.length - offset;
|
10952
10952
|
}
|
10953
10953
|
|
10954
|
+
function toArrayBuffer(view) {
|
10955
|
+
if (view instanceof ArrayBuffer) {
|
10956
|
+
return view;
|
10957
|
+
} else {
|
10958
|
+
if (view.byteOffset == 0 && view.byteLength == view.buffer.byteLength) {
|
10959
|
+
// This is a TypedArray over the whole buffer.
|
10960
|
+
return view.buffer;
|
10961
|
+
}
|
10962
|
+
// This is a 'view' on the buffer. Create a new buffer that only contains
|
10963
|
+
// the data. Note that since this isn't an ArrayBuffer, the 'new' call
|
10964
|
+
// will allocate a new buffer to hold the copy.
|
10965
|
+
return new Uint8Array(view).buffer;
|
10966
|
+
}
|
10967
|
+
}
|
10968
|
+
|
10969
|
+
function toUint8(data, offset, length) {
|
10970
|
+
if (offset === void 0) {
|
10971
|
+
offset = 0;
|
10972
|
+
}
|
10973
|
+
if (length === void 0) {
|
10974
|
+
length = Infinity;
|
10975
|
+
}
|
10976
|
+
return view(data, offset, length, Uint8Array);
|
10977
|
+
}
|
10978
|
+
function view(data, offset, length, Type) {
|
10979
|
+
var buffer = unsafeGetArrayBuffer(data);
|
10980
|
+
var bytesPerElement = 1;
|
10981
|
+
if ('BYTES_PER_ELEMENT' in Type) {
|
10982
|
+
bytesPerElement = Type.BYTES_PER_ELEMENT;
|
10983
|
+
}
|
10984
|
+
// Absolute end of the |data| view within |buffer|.
|
10985
|
+
var dataOffset = isArrayBufferView(data) ? data.byteOffset : 0;
|
10986
|
+
var dataEnd = (dataOffset + data.byteLength) / bytesPerElement;
|
10987
|
+
// Absolute start of the result within |buffer|.
|
10988
|
+
var rawStart = (dataOffset + offset) / bytesPerElement;
|
10989
|
+
var start = Math.floor(Math.max(0, Math.min(rawStart, dataEnd)));
|
10990
|
+
// Absolute end of the result within |buffer|.
|
10991
|
+
var end = Math.floor(Math.min(start + Math.max(length, 0), dataEnd));
|
10992
|
+
return new Type(buffer, start, end - start);
|
10993
|
+
}
|
10994
|
+
function unsafeGetArrayBuffer(view) {
|
10995
|
+
if (view instanceof ArrayBuffer) {
|
10996
|
+
return view;
|
10997
|
+
} else {
|
10998
|
+
return view.buffer;
|
10999
|
+
}
|
11000
|
+
}
|
11001
|
+
function isArrayBufferView(obj) {
|
11002
|
+
return obj && obj.buffer instanceof ArrayBuffer && obj.byteLength !== undefined && obj.byteOffset !== undefined;
|
11003
|
+
}
|
11004
|
+
|
11005
|
+
function decodeId3ImageFrame(frame) {
|
11006
|
+
var metadataFrame = {
|
11007
|
+
key: frame.type,
|
11008
|
+
description: '',
|
11009
|
+
data: '',
|
11010
|
+
mimeType: null,
|
11011
|
+
pictureType: null
|
11012
|
+
};
|
11013
|
+
var utf8Encoding = 0x03;
|
11014
|
+
if (frame.size < 2) {
|
11015
|
+
return undefined;
|
11016
|
+
}
|
11017
|
+
if (frame.data[0] !== utf8Encoding) {
|
11018
|
+
console.log('Ignore frame with unrecognized character ' + 'encoding');
|
11019
|
+
return undefined;
|
11020
|
+
}
|
11021
|
+
var mimeTypeEndIndex = frame.data.subarray(1).indexOf(0);
|
11022
|
+
if (mimeTypeEndIndex === -1) {
|
11023
|
+
return undefined;
|
11024
|
+
}
|
11025
|
+
var mimeType = utf8ArrayToStr(toUint8(frame.data, 1, mimeTypeEndIndex));
|
11026
|
+
var pictureType = frame.data[2 + mimeTypeEndIndex];
|
11027
|
+
var descriptionEndIndex = frame.data.subarray(3 + mimeTypeEndIndex).indexOf(0);
|
11028
|
+
if (descriptionEndIndex === -1) {
|
11029
|
+
return undefined;
|
11030
|
+
}
|
11031
|
+
var description = utf8ArrayToStr(toUint8(frame.data, 3 + mimeTypeEndIndex, descriptionEndIndex));
|
11032
|
+
var data;
|
11033
|
+
if (mimeType === '-->') {
|
11034
|
+
data = utf8ArrayToStr(toUint8(frame.data, 4 + mimeTypeEndIndex + descriptionEndIndex));
|
11035
|
+
} else {
|
11036
|
+
data = toArrayBuffer(frame.data.subarray(4 + mimeTypeEndIndex + descriptionEndIndex));
|
11037
|
+
}
|
11038
|
+
metadataFrame.mimeType = mimeType;
|
11039
|
+
metadataFrame.pictureType = pictureType;
|
11040
|
+
metadataFrame.description = description;
|
11041
|
+
metadataFrame.data = data;
|
11042
|
+
return metadataFrame;
|
11043
|
+
}
|
11044
|
+
|
10954
11045
|
/**
|
10955
11046
|
* Decode an ID3 PRIV frame.
|
10956
11047
|
*
|
@@ -11065,171 +11156,6 @@
|
|
11065
11156
|
};
|
11066
11157
|
}
|
11067
11158
|
|
11068
|
-
/**
|
11069
|
-
* Encodes binary data to base64
|
11070
|
-
*
|
11071
|
-
* @param binary - The binary data to encode
|
11072
|
-
* @returns The base64 encoded string
|
11073
|
-
*
|
11074
|
-
* @group Utils
|
11075
|
-
*
|
11076
|
-
* @beta
|
11077
|
-
*/
|
11078
|
-
function base64encode(binary) {
|
11079
|
-
return btoa(String.fromCharCode.apply(String, binary));
|
11080
|
-
}
|
11081
|
-
|
11082
|
-
/**
|
11083
|
-
* This implements the rounding procedure described in step 2 of the "Serializing a Decimal" specification.
|
11084
|
-
* This rounding style is known as "even rounding", "banker's rounding", or "commercial rounding".
|
11085
|
-
*
|
11086
|
-
* @param value - The value to round
|
11087
|
-
* @param precision - The number of decimal places to round to
|
11088
|
-
* @returns The rounded value
|
11089
|
-
*
|
11090
|
-
* @group Utils
|
11091
|
-
*
|
11092
|
-
* @beta
|
11093
|
-
*/
|
11094
|
-
function roundToEven(value, precision) {
|
11095
|
-
if (value < 0) {
|
11096
|
-
return -roundToEven(-value, precision);
|
11097
|
-
}
|
11098
|
-
var decimalShift = Math.pow(10, precision);
|
11099
|
-
var isEquidistant = Math.abs(value * decimalShift % 1 - 0.5) < Number.EPSILON;
|
11100
|
-
if (isEquidistant) {
|
11101
|
-
// If the tail of the decimal place is 'equidistant' we round to the nearest even value
|
11102
|
-
var flooredValue = Math.floor(value * decimalShift);
|
11103
|
-
return (flooredValue % 2 === 0 ? flooredValue : flooredValue + 1) / decimalShift;
|
11104
|
-
} else {
|
11105
|
-
// Otherwise, proceed as normal
|
11106
|
-
return Math.round(value * decimalShift) / decimalShift;
|
11107
|
-
}
|
11108
|
-
}
|
11109
|
-
|
11110
|
-
/**
|
11111
|
-
* Constructs a relative path from a URL.
|
11112
|
-
*
|
11113
|
-
* @param url - The destination URL
|
11114
|
-
* @param base - The base URL
|
11115
|
-
* @returns The relative path
|
11116
|
-
*
|
11117
|
-
* @group Utils
|
11118
|
-
*
|
11119
|
-
* @beta
|
11120
|
-
*/
|
11121
|
-
function urlToRelativePath(url, base) {
|
11122
|
-
var to = new URL(url);
|
11123
|
-
var from = new URL(base);
|
11124
|
-
if (to.origin !== from.origin) {
|
11125
|
-
return url;
|
11126
|
-
}
|
11127
|
-
var toPath = to.pathname.split('/').slice(1);
|
11128
|
-
var fromPath = from.pathname.split('/').slice(1, -1);
|
11129
|
-
// remove common parents
|
11130
|
-
while (toPath[0] === fromPath[0]) {
|
11131
|
-
toPath.shift();
|
11132
|
-
fromPath.shift();
|
11133
|
-
}
|
11134
|
-
// add back paths
|
11135
|
-
while (fromPath.length) {
|
11136
|
-
fromPath.shift();
|
11137
|
-
toPath.unshift('..');
|
11138
|
-
}
|
11139
|
-
return toPath.join('/');
|
11140
|
-
}
|
11141
|
-
|
11142
|
-
function toArrayBuffer(view) {
|
11143
|
-
if (view instanceof ArrayBuffer) {
|
11144
|
-
return view;
|
11145
|
-
} else {
|
11146
|
-
if (view.byteOffset == 0 && view.byteLength == view.buffer.byteLength) {
|
11147
|
-
// This is a TypedArray over the whole buffer.
|
11148
|
-
return view.buffer;
|
11149
|
-
}
|
11150
|
-
// This is a 'view' on the buffer. Create a new buffer that only contains
|
11151
|
-
// the data. Note that since this isn't an ArrayBuffer, the 'new' call
|
11152
|
-
// will allocate a new buffer to hold the copy.
|
11153
|
-
return new Uint8Array(view).buffer;
|
11154
|
-
}
|
11155
|
-
}
|
11156
|
-
|
11157
|
-
function toUint8(data, offset, length) {
|
11158
|
-
if (offset === void 0) {
|
11159
|
-
offset = 0;
|
11160
|
-
}
|
11161
|
-
if (length === void 0) {
|
11162
|
-
length = Infinity;
|
11163
|
-
}
|
11164
|
-
return view(data, offset, length, Uint8Array);
|
11165
|
-
}
|
11166
|
-
function view(data, offset, length, Type) {
|
11167
|
-
var buffer = unsafeGetArrayBuffer(data);
|
11168
|
-
var bytesPerElement = 1;
|
11169
|
-
if ('BYTES_PER_ELEMENT' in Type) {
|
11170
|
-
bytesPerElement = Type.BYTES_PER_ELEMENT;
|
11171
|
-
}
|
11172
|
-
// Absolute end of the |data| view within |buffer|.
|
11173
|
-
var dataOffset = isArrayBufferView(data) ? data.byteOffset : 0;
|
11174
|
-
var dataEnd = (dataOffset + data.byteLength) / bytesPerElement;
|
11175
|
-
// Absolute start of the result within |buffer|.
|
11176
|
-
var rawStart = (dataOffset + offset) / bytesPerElement;
|
11177
|
-
var start = Math.floor(Math.max(0, Math.min(rawStart, dataEnd)));
|
11178
|
-
// Absolute end of the result within |buffer|.
|
11179
|
-
var end = Math.floor(Math.min(start + Math.max(length, 0), dataEnd));
|
11180
|
-
return new Type(buffer, start, end - start);
|
11181
|
-
}
|
11182
|
-
function unsafeGetArrayBuffer(view) {
|
11183
|
-
if (view instanceof ArrayBuffer) {
|
11184
|
-
return view;
|
11185
|
-
} else {
|
11186
|
-
return view.buffer;
|
11187
|
-
}
|
11188
|
-
}
|
11189
|
-
function isArrayBufferView(obj) {
|
11190
|
-
return obj && obj.buffer instanceof ArrayBuffer && obj.byteLength !== undefined && obj.byteOffset !== undefined;
|
11191
|
-
}
|
11192
|
-
|
11193
|
-
function decodeId3ImageFrame(frame) {
|
11194
|
-
var metadataFrame = {
|
11195
|
-
key: frame.type,
|
11196
|
-
description: '',
|
11197
|
-
data: '',
|
11198
|
-
mimeType: null,
|
11199
|
-
pictureType: null
|
11200
|
-
};
|
11201
|
-
var utf8Encoding = 0x03;
|
11202
|
-
if (frame.size < 2) {
|
11203
|
-
return undefined;
|
11204
|
-
}
|
11205
|
-
if (frame.data[0] !== utf8Encoding) {
|
11206
|
-
console.log('Ignore frame with unrecognized character ' + 'encoding');
|
11207
|
-
return undefined;
|
11208
|
-
}
|
11209
|
-
var mimeTypeEndIndex = frame.data.subarray(1).indexOf(0);
|
11210
|
-
if (mimeTypeEndIndex === -1) {
|
11211
|
-
return undefined;
|
11212
|
-
}
|
11213
|
-
var mimeType = utf8ArrayToStr(toUint8(frame.data, 1, mimeTypeEndIndex));
|
11214
|
-
var pictureType = frame.data[2 + mimeTypeEndIndex];
|
11215
|
-
var descriptionEndIndex = frame.data.subarray(3 + mimeTypeEndIndex).indexOf(0);
|
11216
|
-
if (descriptionEndIndex === -1) {
|
11217
|
-
return undefined;
|
11218
|
-
}
|
11219
|
-
var description = utf8ArrayToStr(toUint8(frame.data, 3 + mimeTypeEndIndex, descriptionEndIndex));
|
11220
|
-
var data;
|
11221
|
-
if (mimeType === '-->') {
|
11222
|
-
data = utf8ArrayToStr(toUint8(frame.data, 4 + mimeTypeEndIndex + descriptionEndIndex));
|
11223
|
-
} else {
|
11224
|
-
data = toArrayBuffer(frame.data.subarray(4 + mimeTypeEndIndex + descriptionEndIndex));
|
11225
|
-
}
|
11226
|
-
metadataFrame.mimeType = mimeType;
|
11227
|
-
metadataFrame.pictureType = pictureType;
|
11228
|
-
metadataFrame.description = description;
|
11229
|
-
metadataFrame.data = data;
|
11230
|
-
return metadataFrame;
|
11231
|
-
}
|
11232
|
-
|
11233
11159
|
/**
|
11234
11160
|
* Decode an ID3 frame.
|
11235
11161
|
*
|
@@ -16751,7 +16677,7 @@
|
|
16751
16677
|
return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
|
16752
16678
|
}
|
16753
16679
|
|
16754
|
-
var version = "1.6.3-0.canary.
|
16680
|
+
var version = "1.6.3-0.canary.11218";
|
16755
16681
|
|
16756
16682
|
// ensure the worker ends up in the bundle
|
16757
16683
|
// If the worker should not be included this gets aliased to empty.js
|
@@ -20723,6 +20649,20 @@
|
|
20723
20649
|
return value ? '?1' : '?0';
|
20724
20650
|
}
|
20725
20651
|
|
20652
|
+
/**
|
20653
|
+
* Encodes binary data to base64
|
20654
|
+
*
|
20655
|
+
* @param binary - The binary data to encode
|
20656
|
+
* @returns The base64 encoded string
|
20657
|
+
*
|
20658
|
+
* @group Utils
|
20659
|
+
*
|
20660
|
+
* @beta
|
20661
|
+
*/
|
20662
|
+
function base64encode(binary) {
|
20663
|
+
return btoa(String.fromCharCode.apply(String, binary));
|
20664
|
+
}
|
20665
|
+
|
20726
20666
|
var BYTES = 'Byte Sequence';
|
20727
20667
|
|
20728
20668
|
// 4.1.8. Serializing a Byte Sequence
|
@@ -20799,6 +20739,34 @@
|
|
20799
20739
|
return "@" + serializeInteger(value.getTime() / 1000);
|
20800
20740
|
}
|
20801
20741
|
|
20742
|
+
/**
|
20743
|
+
* This implements the rounding procedure described in step 2 of the "Serializing a Decimal" specification.
|
20744
|
+
* This rounding style is known as "even rounding", "banker's rounding", or "commercial rounding".
|
20745
|
+
*
|
20746
|
+
* @param value - The value to round
|
20747
|
+
* @param precision - The number of decimal places to round to
|
20748
|
+
* @returns The rounded value
|
20749
|
+
*
|
20750
|
+
* @group Utils
|
20751
|
+
*
|
20752
|
+
* @beta
|
20753
|
+
*/
|
20754
|
+
function roundToEven(value, precision) {
|
20755
|
+
if (value < 0) {
|
20756
|
+
return -roundToEven(-value, precision);
|
20757
|
+
}
|
20758
|
+
var decimalShift = Math.pow(10, precision);
|
20759
|
+
var isEquidistant = Math.abs(value * decimalShift % 1 - 0.5) < Number.EPSILON;
|
20760
|
+
if (isEquidistant) {
|
20761
|
+
// If the tail of the decimal place is 'equidistant' we round to the nearest even value
|
20762
|
+
var flooredValue = Math.floor(value * decimalShift);
|
20763
|
+
return (flooredValue % 2 === 0 ? flooredValue : flooredValue + 1) / decimalShift;
|
20764
|
+
} else {
|
20765
|
+
// Otherwise, proceed as normal
|
20766
|
+
return Math.round(value * decimalShift) / decimalShift;
|
20767
|
+
}
|
20768
|
+
}
|
20769
|
+
|
20802
20770
|
var DECIMAL = 'Decimal';
|
20803
20771
|
|
20804
20772
|
// 4.1.5. Serializing a Decimal
|
@@ -21190,6 +21158,38 @@
|
|
21190
21158
|
return value != null && value !== '' && value !== false;
|
21191
21159
|
}
|
21192
21160
|
|
21161
|
+
/**
|
21162
|
+
* Constructs a relative path from a URL.
|
21163
|
+
*
|
21164
|
+
* @param url - The destination URL
|
21165
|
+
* @param base - The base URL
|
21166
|
+
* @returns The relative path
|
21167
|
+
*
|
21168
|
+
* @group Utils
|
21169
|
+
*
|
21170
|
+
* @beta
|
21171
|
+
*/
|
21172
|
+
function urlToRelativePath(url, base) {
|
21173
|
+
var to = new URL(url);
|
21174
|
+
var from = new URL(base);
|
21175
|
+
if (to.origin !== from.origin) {
|
21176
|
+
return url;
|
21177
|
+
}
|
21178
|
+
var toPath = to.pathname.split('/').slice(1);
|
21179
|
+
var fromPath = from.pathname.split('/').slice(1, -1);
|
21180
|
+
// remove common parents
|
21181
|
+
while (toPath[0] === fromPath[0]) {
|
21182
|
+
toPath.shift();
|
21183
|
+
fromPath.shift();
|
21184
|
+
}
|
21185
|
+
// add back paths
|
21186
|
+
while (fromPath.length) {
|
21187
|
+
fromPath.shift();
|
21188
|
+
toPath.unshift('..');
|
21189
|
+
}
|
21190
|
+
return toPath.join('/');
|
21191
|
+
}
|
21192
|
+
|
21193
21193
|
var toRounded = function toRounded(value) {
|
21194
21194
|
return Math.round(value);
|
21195
21195
|
};
|