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

Commit 462e246

Browse files
authored
fix loopback mode more (#667)
see comments in #666, #657 was wrong
1 parent 1af574b commit 462e246

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/web_app/js/loopback.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,17 @@ function setupLoopback(wssUrl, roomId) {
6161
return;
6262
}
6363
if (message.type === 'offer') {
64-
var loopbackAnswer = wssMessage.msg;
65-
loopbackAnswer = loopbackAnswer.replace('"offer"', '"answer"');
66-
loopbackAnswer =
67-
loopbackAnswer.replace('a=ice-options:google-ice\\r\\n', '');
64+
message.type = 'answer';
65+
message.sdp = message.sdp
66+
.replace('a=ice-options:google-ice\r\n', '')
6867
// As of Chrome M51, an additional crypto method has been added when
6968
// using SDES. This works in a P2P due to the negotiation phase removes
7069
// this line but for loopback where we reuse the offer, that is skipped
7170
// and remains in the answer and breaks the call.
7271
// https://bugs.chromium.org/p/chromium/issues/detail?id=616263
7372
// https://bugs.chromium.org/p/chromium/issues/detail?id=1077740
74-
loopbackAnswer = loopbackAnswer
75-
.replace(/a=crypto:[1-9]+ .*/g, '');
76-
sendLoopbackMessage(JSON.parse(loopbackAnswer));
73+
.replace(/a=crypto:[1-9]+ .*\r\n/g, '');
74+
sendLoopbackMessage(message);
7775
} else if (message.type === 'candidate') {
7876
sendLoopbackMessage(message);
7977
}

0 commit comments

Comments
 (0)