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

This commit is contained in:
George Politis 2014-11-24 13:26:43 +01:00
parent 092149711b
commit 71e290a8ad
1 changed files with 13 additions and 3 deletions

View File

@ -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)