Run simulcastlayerschanged/ing event handlers only if the affected endpoint is in lastN.
This commit is contained in:
parent
092149711b
commit
71e290a8ad
|
@ -1542,6 +1542,12 @@ var VideoLayout = (function (my) {
|
||||||
|
|
||||||
$(document).bind('simulcastlayerschanging', function (event, endpointSimulcastLayers) {
|
$(document).bind('simulcastlayerschanging', function (event, endpointSimulcastLayers) {
|
||||||
endpointSimulcastLayers.forEach(function (esl) {
|
endpointSimulcastLayers.forEach(function (esl) {
|
||||||
|
|
||||||
|
var resource = esl.endpoint;
|
||||||
|
if (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var primarySSRC = esl.simulcastLayer.primarySSRC;
|
var primarySSRC = esl.simulcastLayer.primarySSRC;
|
||||||
|
|
||||||
// Get session and stream from primary ssrc.
|
// Get session and stream from primary ssrc.
|
||||||
|
@ -1589,6 +1595,11 @@ var VideoLayout = (function (my) {
|
||||||
$(document).bind('simulcastlayerschanged', function (event, endpointSimulcastLayers) {
|
$(document).bind('simulcastlayerschanged', function (event, endpointSimulcastLayers) {
|
||||||
endpointSimulcastLayers.forEach(function (esl) {
|
endpointSimulcastLayers.forEach(function (esl) {
|
||||||
|
|
||||||
|
var resource = esl.endpoint;
|
||||||
|
if (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var primarySSRC = esl.simulcastLayer.primarySSRC;
|
var primarySSRC = esl.simulcastLayer.primarySSRC;
|
||||||
|
|
||||||
// Get session and stream from primary ssrc.
|
// Get session and stream from primary ssrc.
|
||||||
|
@ -1644,15 +1655,14 @@ var VideoLayout = (function (my) {
|
||||||
focusedVideoSrc = electedStreamUrl;
|
focusedVideoSrc = electedStreamUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
var jid = ssrc2jid[primarySSRC];
|
|
||||||
var videoId;
|
var videoId;
|
||||||
if(jid == connection.emuc.myroomjid)
|
if(resource == Strophe.getResourceFromJid(connection.emuc.myroomjid))
|
||||||
{
|
{
|
||||||
videoId = "localVideoContainer";
|
videoId = "localVideoContainer";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
videoId = "participant_" + Strophe.getResourceFromJid(jid);
|
videoId = "participant_" + resource;
|
||||||
}
|
}
|
||||||
var connectionIndicator = VideoLayout.connectionIndicators[videoId];
|
var connectionIndicator = VideoLayout.connectionIndicators[videoId];
|
||||||
if(connectionIndicator)
|
if(connectionIndicator)
|
||||||
|
|
Loading…
Reference in New Issue