diff options
author | Jonas Smedegaard <dr@jones.dk> | 2019-09-29 12:19:12 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2019-09-29 12:19:12 +0200 |
commit | d16b12345829a6a18889dd1e22528476581ac37d (patch) | |
tree | e83096d37fefbcb1910f00521e05c0d349978295 /website | |
parent | 8785af7c700433949255225f0ca28a163dfc7203 (diff) |
Fix participant ID being reset (cherry-picked from janus-gateway git commit 0eeae4e).
Diffstat (limited to 'website')
-rw-r--r-- | website/mic.js | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/website/mic.js b/website/mic.js index f948f32..4ab1c37 100644 --- a/website/mic.js +++ b/website/mic.js @@ -271,25 +271,27 @@ $(document).ready(function() { if(event != undefined && event != null) { if(event === "joined") { // Successfully joined, negotiate WebRTC now - myid = msg["id"]; - Janus.log("Successfully joined room " + msg["room"] + " with ID " + myid); - if(!webrtcUp) { - webrtcUp = true; - // Publish our stream - mixertest.createOffer( - { - media: { video: false}, // This is an audio only room - success: function(jsep) { - Janus.debug("Got SDP!"); - Janus.debug(jsep); - var publish = { "request": "configure", "muted": true }; - mixertest.send({"message": publish, "jsep": jsep}); - }, - error: function(error) { - Janus.error("WebRTC error:", error); - bootbox.alert("WebRTC error... " + JSON.stringify(error)); - } - }); + if(msg["id"]) { + myid = msg["id"]; + Janus.log("Successfully joined room " + msg["room"] + " with ID " + myid); + if(!webrtcUp) { + webrtcUp = true; + // Publish our stream + mixertest.createOffer( + { + media: { video: false}, // This is an audio only room + success: function(jsep) { + Janus.debug("Got SDP!"); + Janus.debug(jsep); + var publish = { "request": "configure", "muted": true }; + mixertest.send({"message": publish, "jsep": jsep}); + }, + error: function(error) { + Janus.error("WebRTC error:", error); + bootbox.alert("WebRTC error... " + JSON.stringify(error)); + } + }); + } } // Any room participant? if(msg["participants"] !== undefined && msg["participants"] !== null) { |