Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Run simulcastlayerschanged/ing event handlers only if the affected endpoint is in lastN.

George Politis71e290a8ad78
diff --git a/videolayout.js b/videolayout.js
index 4f77b8cf7d..fbbd9ba63a 100644
--- a/videolayout.js
+++ b/videolayout.js
@@ -1542,6 +1542,12 @@ var VideoLayout = (function (my) {
$(document).bind('simulcastlayerschanging', function (event, endpointSimulcastLayers) {
endpointSimulcastLayers.forEach(function (esl) {
+
+ var resource = esl.endpoint;
+ if (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1) {
+ return;
+ }
+
var primarySSRC = esl.simulcastLayer.primarySSRC;
// Get session and stream from primary ssrc.
@@ -1589,6 +1595,11 @@ var VideoLayout = (function (my) {
$(document).bind('simulcastlayerschanged', function (event, endpointSimulcastLayers) {
endpointSimulcastLayers.forEach(function (esl) {
+ var resource = esl.endpoint;
+ if (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1) {
+ return;
+ }
+
var primarySSRC = esl.simulcastLayer.primarySSRC;
// Get session and stream from primary ssrc.
@@ -1644,15 +1655,14 @@ var VideoLayout = (function (my) {
focusedVideoSrc = electedStreamUrl;
}
- var jid = ssrc2jid[primarySSRC];
var videoId;
- if(jid == connection.emuc.myroomjid)
+ if(resource == Strophe.getResourceFromJid(connection.emuc.myroomjid))
{
videoId = "localVideoContainer";
}
else
{
- videoId = "participant_" + Strophe.getResourceFromJid(jid);
+ videoId = "participant_" + resource;
}
var connectionIndicator = VideoLayout.connectionIndicators[videoId];
if(connectionIndicator)