|
@@ -38,6 +38,8 @@ var getVideoPosition;
|
38
|
38
|
|
39
|
39
|
var preMuted = false;
|
40
|
40
|
|
|
41
|
+var sessionTerminated = false;
|
|
42
|
+
|
41
|
43
|
function init() {
|
42
|
44
|
RTC = setupRTC();
|
43
|
45
|
if (RTC === null) {
|
|
@@ -495,6 +497,7 @@ $(document).bind('callactive.jingle', function (event, videoelem, sid) {
|
495
|
497
|
$(document).bind('callterminated.jingle', function (event, sid, jid, reason) {
|
496
|
498
|
// Leave the room if my call has been remotely terminated.
|
497
|
499
|
if (connection.emuc.joined && focus == null && reason === 'kick') {
|
|
500
|
+ sessionTerminated = true;
|
498
|
501
|
connection.emuc.doLeave();
|
499
|
502
|
openMessageDialog( "Session Terminated",
|
500
|
503
|
"Ouch! You have been kicked out of the meet!");
|
|
@@ -607,9 +610,12 @@ $(document).bind('left.muc', function (event, jid) {
|
607
|
610
|
connection.jingle.terminateByJid(jid);
|
608
|
611
|
|
609
|
612
|
if (focus == null
|
|
613
|
+ // I shouldn't be the one that left to enter here.
|
610
|
614
|
&& jid !== connection.emuc.myroomjid
|
611
|
615
|
&& connection.emuc.myroomjid === connection.emuc.list_members[0]
|
612
|
|
- && connection.emuc.list_members.length > 1) {
|
|
616
|
+ // If our session has been terminated for some reason
|
|
617
|
+ // (kicked, hangup), don't try to become the focus
|
|
618
|
+ && !sessionTerminated) {
|
613
|
619
|
console.log('welcome to our new focus... myself');
|
614
|
620
|
focus = new ColibriFocus(connection, config.hosts.bridge);
|
615
|
621
|
if (Object.keys(connection.emuc.members).length > 0) {
|