1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-08-21 14:52:50 +00:00

webOS: Reverted change for writing header bytes

This commit is contained in:
Michael Hollister 2025-07-29 00:02:47 -05:00
parent 520907fbb8
commit 02fcefc34c

View file

@ -61,7 +61,16 @@ export class FCastSession {
const size = 1 + data.length; const size = 1 + data.length;
const header = Buffer.alloc(4 + 1); const header = Buffer.alloc(4 + 1);
// webOS 22 and earlier node versions do not support `writeUint32LE` despite nodejs stating
// it should be supported in those versions... `writeUIntLE` however works instead.
// @ts-ignore
if (TARGET === 'webOS') {
header.writeUIntLE(size, 0, 4);
} else {
header.writeUint32LE(size, 0); header.writeUint32LE(size, 0);
}
header[4] = opcode; header[4] = opcode;
let packet: Buffer; let packet: Buffer;