From e7869d55f4bfea86b501ab5d9a366f7b88864b60 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Thu, 5 Jun 2025 15:52:37 -0700 Subject: [PATCH] Add note that SDP munging is a deprecated unsupported feature and show the error. --- src/content/peerconnection/munge-sdp/index.html | 4 ++++ src/content/peerconnection/munge-sdp/js/main.js | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/content/peerconnection/munge-sdp/index.html b/src/content/peerconnection/munge-sdp/index.html index e7a6b27622..df325e5f26 100644 --- a/src/content/peerconnection/munge-sdp/index.html +++ b/src/content/peerconnection/munge-sdp/index.html @@ -57,6 +57,10 @@

WebRTC +

Note: SDP "munging", i.e. modifying the SDP between createOffer/createAnswer and setLocalDescription + is a nonstandard feature which may not work as expected. While some browsers support some modifications, + the W3C standard forbids it.

+

diff --git a/src/content/peerconnection/munge-sdp/js/main.js b/src/content/peerconnection/munge-sdp/js/main.js index 05fa2cff82..cb7a509239 100644 --- a/src/content/peerconnection/munge-sdp/js/main.js +++ b/src/content/peerconnection/munge-sdp/js/main.js @@ -138,9 +138,8 @@ 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); @@ -148,7 +147,7 @@ function createPeerConnection() { 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; @@ -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() {