diff --git a/rtpconn/webclient.go b/rtpconn/webclient.go index aea3d74..49f5c7c 100644 --- a/rtpconn/webclient.go +++ b/rtpconn/webclient.go @@ -464,7 +464,7 @@ func negotiate(c *webClient, down *rtpDownConnection, renegotiate, restartIce bo Id: down.id, Source: source, Username: username, - SDP: offer.SDP, + SDP: down.pc.LocalDescription().SDP, Labels: labels, }) } @@ -527,7 +527,7 @@ func gotOffer(c *webClient, id string, sdp string, renegotiate bool, labels map[ return c.write(clientMessage{ Type: "answer", Id: id, - SDP: answer.SDP, + SDP: up.pc.LocalDescription().SDP, }) } diff --git a/static/galene.js b/static/galene.js index 211f3ab..44c02f9 100644 --- a/static/galene.js +++ b/static/galene.js @@ -2090,10 +2090,10 @@ async function relayTest() { let offer = await pc1.createOffer(); await pc1.setLocalDescription(offer); - await pc2.setRemoteDescription(offer); + await pc2.setRemoteDescription(pc1.localDescription); let answer = await pc2.createAnswer(); - pc2.setLocalDescription(answer); - await pc1.setRemoteDescription(answer); + await pc2.setLocalDescription(answer); + await pc1.setRemoteDescription(pc2.localDescription); pc2.ondatachannel = e => { let d2 = e.channel; diff --git a/static/protocol.js b/static/protocol.js index 28c776f..dd93206 100644 --- a/static/protocol.js +++ b/static/protocol.js @@ -595,7 +595,7 @@ ServerConnection.prototype.gotOffer = async function(id, labels, source, usernam this.send({ type: 'answer', id: id, - sdp: answer.sdp, + sdp: c.pc.localDescription.sdp, }); } catch(e) { try { @@ -1021,7 +1021,7 @@ Stream.prototype.negotiate = async function (restartIce) { kind: this.localDescriptionSent ? 'renegotiate' : '', id: c.id, labels: c.labelsByMid, - sdp: offer.sdp, + sdp: c.pc.localDescription.sdp, }); this.localDescriptionSent = true; c.flushLocalIceCandidates();