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
5757 < button id ="setAnswer " disabled > Set answer</ button >
5858 < button id ="hangup " disabled > Hang up</ button >
5959 </ 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 >
6064
6165 < div id ="preview ">
6266 < div id ="local ">
Original file line number Diff line number Diff line change @@ -138,17 +138,16 @@ function createPeerConnection() {
138138 if ( audioTracks . length > 0 ) {
139139 console . log ( `Using audio device: ${ audioTracks [ 0 ] . label } ` ) ;
140140 }
141- const servers = null ;
142141
143- localPeerConnection = new RTCPeerConnection ( servers ) ;
142+ localPeerConnection = new RTCPeerConnection ( ) ;
144143 console . log ( 'Created local peer connection object localPeerConnection' ) ;
145144 localPeerConnection . onicecandidate = e => onIceCandidate ( localPeerConnection , e ) ;
146145 sendChannel = localPeerConnection . createDataChannel ( 'sendDataChannel' , dataChannelOptions ) ;
147146 sendChannel . onopen = onSendChannelStateChange ;
148147 sendChannel . onclose = onSendChannelStateChange ;
149148 sendChannel . onerror = onSendChannelStateChange ;
150149
151- remotePeerConnection = new RTCPeerConnection ( servers ) ;
150+ remotePeerConnection = new RTCPeerConnection ( ) ;
152151 console . log ( 'Created remote peer connection object remotePeerConnection' ) ;
153152 remotePeerConnection . onicecandidate = e => onIceCandidate ( remotePeerConnection , e ) ;
154153 remotePeerConnection . ontrack = gotRemoteStream ;
@@ -165,6 +164,7 @@ function onSetSessionDescriptionSuccess() {
165164
166165function onSetSessionDescriptionError ( error ) {
167166 console . log ( `Failed to set session description: ${ error . toString ( ) } ` ) ;
167+ document . getElementById ( 'munge-error' ) . innerText = error . toString ( ) ;
168168}
169169
170170async function createOffer ( ) {
You can’t perform that action at this time.
0 commit comments