|
@@ -119,7 +119,8 @@ var VideoLayout = (function (my) {
|
119
|
119
|
var newResourceJid;
|
120
|
120
|
// We'll show user's avatar if he is the dominant speaker or if
|
121
|
121
|
// his video thumbnail is pinned
|
122
|
|
- if (resourceJid === focusedVideoResourceJid ||
|
|
122
|
+ if (remoteVideos[resourceJid] &&
|
|
123
|
+ resourceJid === focusedVideoResourceJid ||
|
123
|
124
|
resourceJid === currentDominantSpeaker) {
|
124
|
125
|
newResourceJid = resourceJid;
|
125
|
126
|
} else {
|
|
@@ -137,18 +138,20 @@ var VideoLayout = (function (my) {
|
137
|
138
|
var videoElem = RTC.getVideoElementName();
|
138
|
139
|
var pick = $('#remoteVideos>span[id!="mixedstream"]:visible:last>' + videoElem);
|
139
|
140
|
if (pick.length && APP.RTC.getVideoSrc(pick[0])) {
|
140
|
|
- return VideoLayout.getPeerContainerResourceJid(pick[0].parentNode);
|
|
141
|
+ jid = VideoLayout.getPeerContainerResourceJid(pick[0].parentNode);
|
141
|
142
|
} else {
|
142
|
143
|
console.info("Last visible video no longer exists");
|
143
|
144
|
pick = $('#remoteVideos>span[id!="mixedstream"]>' + videoElem);
|
144
|
145
|
if (pick.length && APP.RTC.getVideoSrc(pick[0])) {
|
145
|
|
- return VideoLayout.getPeerContainerResourceJid(pick[0].parentNode);
|
|
146
|
+ jid = VideoLayout.getPeerContainerResourceJid(pick[0].parentNode);
|
146
|
147
|
} else {
|
147
|
148
|
// Try local video
|
148
|
149
|
console.info("Fallback to local video...");
|
149
|
|
- return APP.xmpp.myResource();
|
|
150
|
+ jid = APP.xmpp.myResource();
|
150
|
151
|
}
|
151
|
152
|
}
|
|
153
|
+ console.info("electLastVisibleVideo: " + jid);
|
|
154
|
+ return jid;
|
152
|
155
|
};
|
153
|
156
|
|
154
|
157
|
my.onRemoteStreamAdded = function (stream) {
|
|
@@ -784,14 +787,6 @@ var VideoLayout = (function (my) {
|
784
|
787
|
remoteVideos[resourceJid].updateStatsIndicator(percent, object);
|
785
|
788
|
};
|
786
|
789
|
|
787
|
|
- /**
|
788
|
|
- * Removes the connection
|
789
|
|
- * @param jid
|
790
|
|
- */
|
791
|
|
- my.removeConnectionIndicator = function (jid) {
|
792
|
|
- remoteVideos[Strophe.getResourceFromJid(jid)].removeConnectionIndicator();
|
793
|
|
- };
|
794
|
|
-
|
795
|
790
|
/**
|
796
|
791
|
* Hides the connection indicator
|
797
|
792
|
* @param jid
|
|
@@ -819,6 +814,23 @@ var VideoLayout = (function (my) {
|
819
|
814
|
console.info("Focused video owner has left the conference");
|
820
|
815
|
focusedVideoResourceJid = null;
|
821
|
816
|
}
|
|
817
|
+
|
|
818
|
+ if (currentDominantSpeaker === resourceJid)
|
|
819
|
+ {
|
|
820
|
+ console.info("Dominant speaker has left the conference");
|
|
821
|
+ currentDominantSpeaker = null;
|
|
822
|
+ }
|
|
823
|
+
|
|
824
|
+ var remoteVideo = remoteVideos[resourceJid];
|
|
825
|
+ if (remoteVideo) {
|
|
826
|
+ remoteVideo.removeConnectionIndicator();
|
|
827
|
+ // Remove remote video
|
|
828
|
+ delete remoteVideos[resourceJid];
|
|
829
|
+ } else {
|
|
830
|
+ console.warn("No remote video for " + resourceJid);
|
|
831
|
+ }
|
|
832
|
+
|
|
833
|
+ VideoLayout.resizeThumbnails();
|
822
|
834
|
};
|
823
|
835
|
|
824
|
836
|
my.onVideoTypeChanged = function (jid) {
|