Skip to content

Commit 91fdaa8

Browse files
committed
check bytes received
1 parent 69f34f0 commit 91fdaa8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

demo/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,19 @@ $(() => {
269269
session
270270
.accept()
271271
.then(() => {
272+
const pc = session.sessionDescriptionHandler?.peerConnection as RTCPeerConnection;
273+
setTimeout(async () => {
274+
const stats = await pc.getStats();
275+
stats.forEach((report) => {
276+
if(report.kind === "audio" && report.type === 'inbound-rtp') {
277+
console.log(report);
278+
if(report.bytesReceived < 1000) {
279+
console.warn('not enough audio data received, probably one way audio issue');
280+
}
281+
}
282+
});
283+
}, 3000);
284+
272285
$modal.modal('hide');
273286
onAccepted(session);
274287
})

0 commit comments

Comments
 (0)