Skip to content

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

Fixes issue introduced by 71e290a8ad78daa2873a12fb89148c9cbf08d2c5.

George Politis37bb4b82adcb
diff --git a/videolayout.js b/videolayout.js
index e6915be0d8..f375934a1c 100644
--- a/videolayout.js
+++ b/videolayout.js
@@ -1640,7 +1640,15 @@ var VideoLayout = (function (my) {
endpointSimulcastLayers.forEach(function (esl) {
var resource = esl.endpoint;
- if (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1) {
+
+ // if lastN is enabled *and* the endpoint is *not* in the lastN set,
+ // then ignore the event (= do not preload anything).
+ //
+ // The bridge could probably stop sending this message if it's for
+ // an endpoint that's not in lastN.
+
+ if (lastNCount != -1
+ && (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1)) {
return;
}
@@ -1692,7 +1700,19 @@ var VideoLayout = (function (my) {
endpointSimulcastLayers.forEach(function (esl) {
var resource = esl.endpoint;
- if (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1) {
+
+ // if lastN is enabled *and* the endpoint is *not* in the lastN set,
+ // then ignore the event (= do not change large video/thumbnail
+ // SRCs).
+ //
+ // Note that even if we ignore the "changing" event in this event
+ // handler, the bridge must continue sending these events because
+ // the simulcast code in simulcast.js handles it to know what's
+ // going to be streamed by the bridge when/if the endpoint gets back
+ // into the lastN set.
+
+ if (lastNCount != -1
+ && (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1)) {
return;
}