File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
src/content/peerconnection/munge-sdp Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,10 @@ <h1><a href="//webrtc.github.io/samples/" title="WebRTC samples homepage">WebRTC
57
57
< button id ="setAnswer " disabled > Set answer</ button >
58
58
< button id ="hangup " disabled > Hang up</ button >
59
59
</ div >
60
+ < p > < b > Note:</ b > SDP "munging", i.e. modifying the SDP between < i > createOffer</ i > /< i > createAnswer</ i > and < i > setLocalDescription</ i >
61
+ is a nonstandard feature which may not work as expected. While some browsers support some modifications,
62
+ < a href ="https://w3c.github.io/webrtc-pc/#dom-peerconnection-setlocaldescription "> the W3C standard</ a > forbids it.</ p >
63
+ < p id ="munge-error "> </ p >
60
64
61
65
< div id ="preview ">
62
66
< div id ="local ">
Original file line number Diff line number Diff line change @@ -138,17 +138,16 @@ function createPeerConnection() {
138
138
if ( audioTracks . length > 0 ) {
139
139
console . log ( `Using audio device: ${ audioTracks [ 0 ] . label } ` ) ;
140
140
}
141
- const servers = null ;
142
141
143
- localPeerConnection = new RTCPeerConnection ( servers ) ;
142
+ localPeerConnection = new RTCPeerConnection ( ) ;
144
143
console . log ( 'Created local peer connection object localPeerConnection' ) ;
145
144
localPeerConnection . onicecandidate = e => onIceCandidate ( localPeerConnection , e ) ;
146
145
sendChannel = localPeerConnection . createDataChannel ( 'sendDataChannel' , dataChannelOptions ) ;
147
146
sendChannel . onopen = onSendChannelStateChange ;
148
147
sendChannel . onclose = onSendChannelStateChange ;
149
148
sendChannel . onerror = onSendChannelStateChange ;
150
149
151
- remotePeerConnection = new RTCPeerConnection ( servers ) ;
150
+ remotePeerConnection = new RTCPeerConnection ( ) ;
152
151
console . log ( 'Created remote peer connection object remotePeerConnection' ) ;
153
152
remotePeerConnection . onicecandidate = e => onIceCandidate ( remotePeerConnection , e ) ;
154
153
remotePeerConnection . ontrack = gotRemoteStream ;
@@ -165,6 +164,7 @@ function onSetSessionDescriptionSuccess() {
165
164
166
165
function onSetSessionDescriptionError ( error ) {
167
166
console . log ( `Failed to set session description: ${ error . toString ( ) } ` ) ;
167
+ document . getElementById ( 'munge-error' ) . innerText = error . toString ( ) ;
168
168
}
169
169
170
170
async function createOffer ( ) {
You can’t perform that action at this time.
0 commit comments