Skip to content

How to solve the problem of bufferedAmount being full #143

Open
@kingtonlee

Description

@kingtonlee

How to implement the following code using Java. When the bufferedAmount changes, onBufferedAmountChange is not executed, and the bufferedAmount cannot be reduced. It always remains at the critical value of 16M.

const send = () => {
while (buffer.byteLength) {
if (dataChannel.bufferedAmount > dataChannel.bufferedAmountLowThreshold) {
dataChannel.onbufferedamountlow = () => {
dataChannel.onbufferedamountlow = null;
send();
};
return;
}
const chunk = buffer.slice(0, chunkSize);
buffer = buffer.slice(chunkSize, buffer.byteLength);
dataChannel.send(chunk);
}
};
send();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions