From 4257e2c6ff2e16a3acf31fe056e31cbfb1cc22ed Mon Sep 17 00:00:00 2001 From: Periodic1911 Date: Wed, 28 Aug 2019 21:25:26 +0000 Subject: [PATCH] Fix bug for Scalable-Broadcast When running the current Scalable-Broadcast demo (https://rtcmulticonnection.herokuapp.com/demos/Scalable-Broadcast.html) watchers on at least chrome and firefox cannot open a stream. This is because the browser tries to set the local answer sdp in a stable state. The solution is to not negotiate a new state when the state is stable. --- dist/RTCMultiConnection.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dist/RTCMultiConnection.js b/dist/RTCMultiConnection.js index 31e88c83..7efd6ddb 100644 --- a/dist/RTCMultiConnection.js +++ b/dist/RTCMultiConnection.js @@ -13,7 +13,7 @@ // -------------------------------------------------- var RTCMultiConnection = function(roomid, forceOptions) { - + var isNegotiating = false; var browserFakeUserAgent = 'Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45'; (function(that) { @@ -2649,6 +2649,10 @@ var RTCMultiConnection = function(roomid, forceOptions) { }); peer.oniceconnectionstatechange = peer.onsignalingstatechange = function() { + if(self.signalingState != "stable") { + console.log("Negotiation skipped in stable"); + return; + } var extra = self.extra; if (connection.peers[self.userid]) { extra = connection.peers[self.userid].extra || extra;