participants stale issue
This commit is contained in:
@@ -2047,6 +2047,42 @@
|
||||
return getPoliticTalkRenderedParticipantTiles(videospace, 44, 44).length;
|
||||
}
|
||||
|
||||
function getPoliticTalkRemoteParticipantCount(videospace, tiles, thumbnails) {
|
||||
var room = getPoliticTalkConferenceRoom();
|
||||
|
||||
try {
|
||||
if (room && typeof room.getParticipants === 'function') {
|
||||
return room.getParticipants().length;
|
||||
}
|
||||
} catch (error) {
|
||||
// Fall back to visible tile state when Jitsi internals are unavailable.
|
||||
}
|
||||
|
||||
var localEndpointId = getPoliticTalkLocalEndpointId();
|
||||
var countedIds = {};
|
||||
var candidates = (tiles || []).concat(thumbnails || []);
|
||||
|
||||
if (videospace) {
|
||||
candidates = candidates.concat(getPoliticTalkRenderedParticipantTiles(videospace, 44, 44));
|
||||
}
|
||||
|
||||
candidates.forEach(function(candidate) {
|
||||
if (!candidate || candidate.id === 'localVideo_container') {
|
||||
return;
|
||||
}
|
||||
|
||||
var endpointId = getPoliticTalkTileEndpointId(candidate);
|
||||
|
||||
if (endpointId && localEndpointId && endpointId === localEndpointId) {
|
||||
return;
|
||||
}
|
||||
|
||||
countedIds[endpointId || candidate.id || String(Object.keys(countedIds).length)] = true;
|
||||
});
|
||||
|
||||
return Object.keys(countedIds).length;
|
||||
}
|
||||
|
||||
function isPoliticTalkAvatarShell(element, tile) {
|
||||
if (!element || element === tile || element.tagName === 'IMG' || element.tagName === 'CANVAS') {
|
||||
return false;
|
||||
@@ -2760,7 +2796,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
function applyPoliticTalkLargeVideoLayout(videospace, tiles) {
|
||||
function applyPoliticTalkLargeVideoLayout(videospace, tiles, thumbnails) {
|
||||
if (!videospace) {
|
||||
return;
|
||||
}
|
||||
@@ -2774,8 +2810,9 @@
|
||||
var candidateTileCount = Array.isArray(tiles) ? tiles.length : 0;
|
||||
var renderedTileCount = getPoliticTalkRenderedParticipantTileCount(videospace);
|
||||
var visibleTileCount = Math.max(candidateTileCount, renderedTileCount);
|
||||
var remoteParticipantCount = getPoliticTalkRemoteParticipantCount(videospace, tiles, thumbnails);
|
||||
|
||||
setPoliticTalkDominantSpeakerLayerVisibility(videospace, visibleTileCount <= 1);
|
||||
setPoliticTalkDominantSpeakerLayerVisibility(videospace, remoteParticipantCount > 0 && visibleTileCount <= 1);
|
||||
|
||||
var availableHeight = getPoliticTalkAvailableTileHeight(videospace);
|
||||
|
||||
@@ -2886,7 +2923,7 @@
|
||||
);
|
||||
var dominantMetadata = getPoliticTalkDominantSpeakerRoleMetadata(videospace, tiles, thumbnails);
|
||||
|
||||
applyPoliticTalkLargeVideoLayout(videospace, tiles);
|
||||
applyPoliticTalkLargeVideoLayout(videospace, tiles, thumbnails);
|
||||
applyPoliticTalkTileLayout(videospace, tiles);
|
||||
applyPoliticTalkDominantSpeakerTheme(videospace, tiles, thumbnails, dominantMetadata);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user