|
@@ -126,12 +126,11 @@ var VideoLayout = (function (my) {
|
126
|
126
|
/**
|
127
|
127
|
* Checks if removed video is currently displayed and tries to display
|
128
|
128
|
* another one instead.
|
129
|
|
- * @param removedVideoSrc src stream identifier of the video.
|
130
|
129
|
*/
|
131
|
130
|
my.updateRemovedVideo = function(resourceJid) {
|
|
131
|
+ var newResourceJid;
|
132
|
132
|
|
133
|
133
|
if (resourceJid === LargeVideo.getResourceJid()) {
|
134
|
|
- var newResourceJid;
|
135
|
134
|
// We'll show user's avatar if he is the dominant speaker or if
|
136
|
135
|
// his video thumbnail is pinned
|
137
|
136
|
if (remoteVideos[resourceJid] &&
|
|
@@ -153,18 +152,32 @@ var VideoLayout = (function (my) {
|
153
|
152
|
var pick = $('#remoteVideos>span[id!="mixedstream"]:visible:last');
|
154
|
153
|
if (pick.length) {
|
155
|
154
|
jid = VideoLayout.getPeerContainerResourceJid(pick[0]);
|
156
|
|
- } else {
|
|
155
|
+ if (!remoteVideos[jid]) {
|
|
156
|
+ // The RemoteVideo was removed (but the DOM elements may still
|
|
157
|
+ // exist).
|
|
158
|
+ jid = null;
|
|
159
|
+ }
|
|
160
|
+ }
|
|
161
|
+
|
|
162
|
+ if (!jid) {
|
157
|
163
|
console.info("Last visible video no longer exists");
|
158
|
164
|
pick = $('#remoteVideos>span[id!="mixedstream"]');
|
159
|
165
|
if (pick.length) {
|
160
|
166
|
jid = VideoLayout.getPeerContainerResourceJid(pick[0]);
|
161
|
|
- }
|
162
|
|
- if (!jid) {
|
163
|
|
- // Go with local video
|
164
|
|
- console.info("Fallback to local video...");
|
165
|
|
- jid = APP.xmpp.myResource();
|
|
167
|
+ if (!remoteVideos[jid]) {
|
|
168
|
+ // The RemoteVideo was removed (but the DOM elements may
|
|
169
|
+ // still exist).
|
|
170
|
+ jid = null;
|
|
171
|
+ }
|
166
|
172
|
}
|
167
|
173
|
}
|
|
174
|
+
|
|
175
|
+ if (!jid) {
|
|
176
|
+ // Go with local video
|
|
177
|
+ console.info("Fallback to local video...");
|
|
178
|
+ jid = APP.xmpp.myResource();
|
|
179
|
+ }
|
|
180
|
+
|
168
|
181
|
console.info("electLastVisibleVideo: " + jid);
|
169
|
182
|
return jid;
|
170
|
183
|
};
|
|
@@ -830,8 +843,7 @@ var VideoLayout = (function (my) {
|
830
|
843
|
focusedVideoResourceJid = null;
|
831
|
844
|
}
|
832
|
845
|
|
833
|
|
- if (currentDominantSpeaker === resourceJid)
|
834
|
|
- {
|
|
846
|
+ if (currentDominantSpeaker === resourceJid) {
|
835
|
847
|
console.info("Dominant speaker has left the conference");
|
836
|
848
|
currentDominantSpeaker = null;
|
837
|
849
|
}
|
|
@@ -840,8 +852,8 @@ var VideoLayout = (function (my) {
|
840
|
852
|
if (remoteVideo) {
|
841
|
853
|
// Remove remote video
|
842
|
854
|
console.info("Removing remote video: " + resourceJid);
|
843
|
|
- remoteVideo.remove();
|
844
|
855
|
delete remoteVideos[resourceJid];
|
|
856
|
+ remoteVideo.remove();
|
845
|
857
|
} else {
|
846
|
858
|
console.warn("No remote video for " + resourceJid);
|
847
|
859
|
}
|