Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"></head>
<body>
<div id="Page that opens a single peerconnection"></div>
<script>
let test = async () => {
let pc = new RTCPeerConnection();
pc.addTransceiver('audio');
pc.addTransceiver('video');
await pc.setLocalDescription();
await new Promise(r => {
pc.onicegatheringstatechange = () => {
if (pc.iceGatheringState == "complete") {
r();
}
};
});
};
test();
</script>
</body>
</html>