Browse Source

Fixes issue introduced by 71e290a8ad.

simulcastlayerschanged/ing should run if lastN is disabled.
master
George Politis 11 years ago
parent
commit
37bb4b82ad
1 changed files with 22 additions and 2 deletions
  1. 22
    2
      videolayout.js

+ 22
- 2
videolayout.js View File

@@ -1640,7 +1640,15 @@ var VideoLayout = (function (my) {
1640 1640
         endpointSimulcastLayers.forEach(function (esl) {
1641 1641
 
1642 1642
             var resource = esl.endpoint;
1643
-            if (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1) {
1643
+
1644
+            // if lastN is enabled *and* the endpoint is *not* in the lastN set,
1645
+            // then ignore the event (= do not preload anything).
1646
+            //
1647
+            // The bridge could probably stop sending this message if it's for
1648
+            // an endpoint that's not in lastN.
1649
+
1650
+            if (lastNCount != -1
1651
+                && (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1)) {
1644 1652
                 return;
1645 1653
             }
1646 1654
 
@@ -1692,7 +1700,19 @@ var VideoLayout = (function (my) {
1692 1700
         endpointSimulcastLayers.forEach(function (esl) {
1693 1701
 
1694 1702
             var resource = esl.endpoint;
1695
-            if (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1) {
1703
+
1704
+            // if lastN is enabled *and* the endpoint is *not* in the lastN set,
1705
+            // then ignore the event (= do not change large video/thumbnail
1706
+            // SRCs).
1707
+            //
1708
+            // Note that even if we ignore the "changing" event in this event
1709
+            // handler, the bridge must continue sending these events because
1710
+            // the simulcast code in simulcast.js handles it to know what's
1711
+            // going to be streamed by the bridge when/if the endpoint gets back
1712
+            // into the lastN set.
1713
+
1714
+            if (lastNCount != -1
1715
+                && (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1)) {
1696 1716
                 return;
1697 1717
             }
1698 1718
 

Loading…
Cancel
Save