@tianfeng98/hls.js
Version:
HLS.js is a JavaScript library that supports playing MPEG-TS and HEVC encoded HLS streams in browsers with support for MSE.
12 lines (11 loc) • 399 B
text/typescript
export function sliceUint8(
array: Uint8Array,
start?: number,
end?: number,
): Uint8Array {
// @ts-expect-error This polyfills IE11 usage of Uint8Array slice.
// It always exists in the TypeScript definition so fails, but it fails at runtime on IE11.
return Uint8Array.prototype.slice
? array.slice(start, end)
: new Uint8Array(Array.prototype.slice.call(array, start, end));
}