Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/content/peerconnection/munge-sdp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ <h1><a href="//webrtc.github.io/samples/" title="WebRTC samples homepage">WebRTC
<button id="setAnswer" disabled>Set answer</button>
<button id="hangup" disabled>Hang up</button>
</div>
<p><b>Note:</b> SDP "munging", i.e. modifying the SDP between <i>createOffer</i>/<i>createAnswer</i> and <i>setLocalDescription</i>
is a nonstandard feature which may not work as expected. While some browsers support some modifications,
<a href="https://w3c.github.io/webrtc-pc/#dom-peerconnection-setlocaldescription">the W3C standard</a> forbids it.</p>
<p id="munge-error"></p>

<div id="preview">
<div id="local">
Expand Down
6 changes: 3 additions & 3 deletions src/content/peerconnection/munge-sdp/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,16 @@ function createPeerConnection() {
if (audioTracks.length > 0) {
console.log(`Using audio device: ${audioTracks[0].label}`);
}
const servers = null;

localPeerConnection = new RTCPeerConnection(servers);
localPeerConnection = new RTCPeerConnection();
console.log('Created local peer connection object localPeerConnection');
localPeerConnection.onicecandidate = e => onIceCandidate(localPeerConnection, e);
sendChannel = localPeerConnection.createDataChannel('sendDataChannel', dataChannelOptions);
sendChannel.onopen = onSendChannelStateChange;
sendChannel.onclose = onSendChannelStateChange;
sendChannel.onerror = onSendChannelStateChange;

remotePeerConnection = new RTCPeerConnection(servers);
remotePeerConnection = new RTCPeerConnection();
console.log('Created remote peer connection object remotePeerConnection');
remotePeerConnection.onicecandidate = e => onIceCandidate(remotePeerConnection, e);
remotePeerConnection.ontrack = gotRemoteStream;
Expand All @@ -165,6 +164,7 @@ function onSetSessionDescriptionSuccess() {

function onSetSessionDescriptionError(error) {
console.log(`Failed to set session description: ${error.toString()}`);
document.getElementById('munge-error').innerText = error.toString();
}

async function createOffer() {
Expand Down