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

fix loopback mode more #667

Merged
merged 1 commit into from
Jun 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/web_app/js/loopback.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down