@videojs/http-streaming
Version:
Play back HLS and DASH with Video.js, even where it's not natively supported
9 lines (6 loc) • 307 B
JavaScript
export const uint8ToUtf8 = (uintArray) =>
decodeURIComponent(escape(String.fromCharCode.apply(null, uintArray)));
export const bufferToHexString = (buffer) => {
const uInt8Buffer = new Uint8Array(buffer);
return Array.from(uInt8Buffer).map((byte) => byte.toString(16).padStart(2, '0')).join('');
};