Pārlūkot izejas kodu

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

master
George Politis 11 gadus atpakaļ
vecāks
revīzija
71e290a8ad
1 mainītis faili ar 13 papildinājumiem un 3 dzēšanām
  1. 13
    3
      videolayout.js

+ 13
- 3
videolayout.js Parādīt failu

@@ -1542,6 +1542,12 @@ var VideoLayout = (function (my) {
1542 1542
 
1543 1543
     $(document).bind('simulcastlayerschanging', function (event, endpointSimulcastLayers) {
1544 1544
         endpointSimulcastLayers.forEach(function (esl) {
1545
+
1546
+            var resource = esl.endpoint;
1547
+            if (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1) {
1548
+                return;
1549
+            }
1550
+
1545 1551
             var primarySSRC = esl.simulcastLayer.primarySSRC;
1546 1552
 
1547 1553
             // Get session and stream from primary ssrc.
@@ -1589,6 +1595,11 @@ var VideoLayout = (function (my) {
1589 1595
     $(document).bind('simulcastlayerschanged', function (event, endpointSimulcastLayers) {
1590 1596
         endpointSimulcastLayers.forEach(function (esl) {
1591 1597
 
1598
+            var resource = esl.endpoint;
1599
+            if (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1) {
1600
+                return;
1601
+            }
1602
+
1592 1603
             var primarySSRC = esl.simulcastLayer.primarySSRC;
1593 1604
 
1594 1605
             // Get session and stream from primary ssrc.
@@ -1644,15 +1655,14 @@ var VideoLayout = (function (my) {
1644 1655
                     focusedVideoSrc = electedStreamUrl;
1645 1656
                 }
1646 1657
 
1647
-                var jid = ssrc2jid[primarySSRC];
1648 1658
                 var videoId;
1649
-                if(jid == connection.emuc.myroomjid)
1659
+                if(resource == Strophe.getResourceFromJid(connection.emuc.myroomjid))
1650 1660
                 {
1651 1661
                     videoId = "localVideoContainer";
1652 1662
                 }
1653 1663
                 else
1654 1664
                 {
1655
-                    videoId = "participant_" + Strophe.getResourceFromJid(jid);
1665
+                    videoId = "participant_" + resource;
1656 1666
                 }
1657 1667
                 var connectionIndicator = VideoLayout.connectionIndicators[videoId];
1658 1668
                 if(connectionIndicator)

Notiek ielāde…
Atcelt
Saglabāt