Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
fix loopback mode more (#667)
Browse files Browse the repository at this point in the history
see comments in #666, #657 was wrong
fippo authored Jun 18, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 1af574b commit 462e246
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/web_app/js/loopback.js
Original file line number Diff line number Diff line change
@@ -61,19 +61,17 @@ function setupLoopback(wssUrl, roomId) {
return;
}
if (message.type === 'offer') {
var loopbackAnswer = wssMessage.msg;
loopbackAnswer = loopbackAnswer.replace('"offer"', '"answer"');
loopbackAnswer =
loopbackAnswer.replace('a=ice-options:google-ice\\r\\n', '');
message.type = 'answer';
message.sdp = message.sdp
.replace('a=ice-options:google-ice\r\n', '')
// As of Chrome M51, an additional crypto method has been added when
// using SDES. This works in a P2P due to the negotiation phase removes
// this line but for loopback where we reuse the offer, that is skipped
// and remains in the answer and breaks the call.
// https://bugs.chromium.org/p/chromium/issues/detail?id=616263
// https://bugs.chromium.org/p/chromium/issues/detail?id=1077740
loopbackAnswer = loopbackAnswer
.replace(/a=crypto:[1-9]+ .*/g, '');
sendLoopbackMessage(JSON.parse(loopbackAnswer));
.replace(/a=crypto:[1-9]+ .*\r\n/g, '');
sendLoopbackMessage(message);
} else if (message.type === 'candidate') {
sendLoopbackMessage(message);
}

0 comments on commit 462e246

Please sign in to comment.