Skip to content
Open
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/cuddly-ties-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-client": patch
---

Wait for dc buffer status low for all published packets
3 changes: 2 additions & 1 deletion src/room/RTCEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,6 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit
}),
},
});

await this.sendDataPacket(packet, DataPacket_Kind.RELIABLE);
}

Expand Down Expand Up @@ -1269,6 +1268,8 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit

const msg = packet.toBinary();

await this.waitForBufferStatusLow(kind);

const dc = this.dataChannelForKind(kind);
if (dc) {
if (kind === DataPacket_Kind.RELIABLE) {
Expand Down
2 changes: 0 additions & 2 deletions src/room/data-stream/outgoing/OutgoingDataStreamManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ export default class OutgoingDataStreamManager {
// Implement the sink
async write(text) {
for (const textByteChunk of splitUtf8(text, STREAM_CHUNK_SIZE)) {
await engine.waitForBufferStatusLow(DataPacket_Kind.RELIABLE);
const chunk = new DataStream_Chunk({
content: textByteChunk,
streamId,
Expand Down Expand Up @@ -278,7 +277,6 @@ export default class OutgoingDataStreamManager {
try {
while (byteOffset < chunk.byteLength) {
const subChunk = chunk.slice(byteOffset, byteOffset + STREAM_CHUNK_SIZE);
await engine.waitForBufferStatusLow(DataPacket_Kind.RELIABLE);
const chunkPacket = new DataPacket({
destinationIdentities,
value: {
Expand Down
Loading