Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fifty-shoes-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-client": patch
---

Fix TS 5.9 generic Uint8Array declaration when inferred
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"typesVersions": {
"<4.8": {
"./dist/src/index.d.ts": [
"./dist/ts4.2/src/index.d.ts"
"./dist/ts4.2/index.d.ts"
],
"./dist/src/e2ee/worker/e2ee.worker.d.ts": [
"./dist/ts4.2/dist/src/e2ee/worker/e2ee.worker.d.ts"
"./dist/ts4.2/e2ee/worker/e2ee.worker.d.ts"
]
}
},
Expand All @@ -50,7 +50,7 @@
"format": "prettier --write src examples/**/*.ts",
"format:check": "prettier --check src examples/**/*.ts",
"ci:publish": "pnpm build:clean && pnpm compat && changeset publish",
"downlevel-dts": "downlevel-dts ./dist/ ./dist/ts4.2 --to=4.2",
"downlevel-dts": "downlevel-dts ./dist/src ./dist/ts4.2 --to=4.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive by fix that ensures we really only downlevel the emitted d.ts files in the dist/src folder where the original source types are emitted to.

"compat": "eslint --no-eslintrc --config ./.eslintrc.dist.cjs ./dist/livekit-client.umd.js",
"size-limit": "size-limit"
},
Expand Down
16 changes: 10 additions & 6 deletions src/e2ee/worker/sifPayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,29 @@ import type { VideoCodec } from '../..';

// Payload definitions taken from https://github.com/livekit/livekit/blob/master/pkg/sfu/downtrack.go#L104

export const VP8KeyFrame8x8 = new Uint8Array([
export const VP8KeyFrame8x8: Uint8Array = new Uint8Array([
0x10, 0x02, 0x00, 0x9d, 0x01, 0x2a, 0x08, 0x00, 0x08, 0x00, 0x00, 0x47, 0x08, 0x85, 0x85, 0x88,
0x85, 0x84, 0x88, 0x02, 0x02, 0x00, 0x0c, 0x0d, 0x60, 0x00, 0xfe, 0xff, 0xab, 0x50, 0x80,
]);

export const H264KeyFrame2x2SPS = new Uint8Array([
export const H264KeyFrame2x2SPS: Uint8Array = new Uint8Array([
0x67, 0x42, 0xc0, 0x1f, 0x0f, 0xd9, 0x1f, 0x88, 0x88, 0x84, 0x00, 0x00, 0x03, 0x00, 0x04, 0x00,
0x00, 0x03, 0x00, 0xc8, 0x3c, 0x60, 0xc9, 0x20,
]);

export const H264KeyFrame2x2PPS = new Uint8Array([0x68, 0x87, 0xcb, 0x83, 0xcb, 0x20]);
export const H264KeyFrame2x2PPS: Uint8Array = new Uint8Array([0x68, 0x87, 0xcb, 0x83, 0xcb, 0x20]);

export const H264KeyFrame2x2IDR = new Uint8Array([
export const H264KeyFrame2x2IDR: Uint8Array = new Uint8Array([
0x65, 0x88, 0x84, 0x0a, 0xf2, 0x62, 0x80, 0x00, 0xa7, 0xbe,
]);

export const H264KeyFrame2x2 = [H264KeyFrame2x2SPS, H264KeyFrame2x2PPS, H264KeyFrame2x2IDR];
export const H264KeyFrame2x2: Uint8Array[] = [
H264KeyFrame2x2SPS,
H264KeyFrame2x2PPS,
H264KeyFrame2x2IDR,
];

export const OpusSilenceFrame = new Uint8Array([
export const OpusSilenceFrame: Uint8Array = new Uint8Array([
0xf8, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand Down
2 changes: 1 addition & 1 deletion src/room/track/LocalTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ export default abstract class LocalTrack<
}

/** @internal */
getPreConnectBuffer() {
getPreConnectBuffer(): ReadableStream<Uint8Array> | undefined {
return this.localTrackRecorder?.byteStream;
}

Expand Down
Loading