const dc = peerConnection.createDataChannel("File Transfer");
// …
function showBufferedAmount(channel) {
const el = document.getElementById("bufferSize");
el.innerText = `${channel.bufferedAmount} bytes`;
}RTCDataChannel: bufferedAmount property / notebook
RTCDataChannel: bufferedAmount property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.