async function getTransportStats(peerConnection) {
const stats = await peerConnection.getStats();
for (const report of stats.values()) {
if (report.type === "transport") {
return report;
}
}
return null;
}RTCTransportStats / notebook
RTCTransportStats
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.