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:
parent
520907fbb8
commit
02fcefc34c
1 changed files with 10 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue