rtcpeerconnection
Version:
A tiny browser module that normalizes and simplifies the API for WebRTC peer connections.
20 lines (19 loc) • 459 B
HTML
<html>
<head>
<meta charset="utf-8">
<title>Test page for adapter.js</title>
</head>
<body>
<h1>Test page for adapter.js</h1>
<script src="./sdpsemantics.min.js"></script>
<script>
var pc = new RTCPeerConnection({sdpSemantics: 'jingle'});
navigator.mediaDevices.getUserMedia({audio: true})
.then((stream) => pc.addStream(stream))
.then(() => pc.createOffer({offerToReceiveAudio: false}))
.then((offer) => {
console.log(offer);
});
</script>
</body>
</html>