Revert "fix(large-video)pin prev speaker on stage when local user is dominant speaker. (#16511)"

This reverts commit 82d4628976.
This commit is contained in:
Jaya Allamsetty
2025-11-03 13:15:56 -05:00
committed by Jaya Allamsetty
parent 1138b7779b
commit 81a7301a3e
7 changed files with 109 additions and 249 deletions

View File

@@ -579,50 +579,6 @@ export class Participant {
return new LargeVideo(this);
}
/**
* Waits for a specific participant to be displayed on large video.
*
* @param {string} expectedEndpointId - The endpoint ID of the participant expected on large video.
* @param {string} timeoutMsg - Optional custom timeout message.
* @param {number} timeout - Optional timeout in milliseconds (default: 30000).
* @returns {Promise<void>}
*/
async waitForParticipantOnLargeVideo(
expectedEndpointId: string,
timeoutMsg?: string,
timeout: number = 30_000): Promise<void> {
await this.driver.waitUntil(
async () => await this.getLargeVideo().getResource() === expectedEndpointId,
{
timeout,
timeoutMsg: timeoutMsg || `Expected ${expectedEndpointId} on large video for ${this.name}`
});
}
/**
* Waits for any one of the specified participants to be displayed on large video.
*
* @param {string[]} expectedEndpointIds - Array of endpoint IDs, any one of which is expected on large video.
* @param {string} timeoutMsg - Optional custom timeout message.
* @param {number} timeout - Optional timeout in milliseconds (default: 30000).
* @returns {Promise<void>}
*/
async waitForAnyParticipantOnLargeVideo(
expectedEndpointIds: string[],
timeoutMsg?: string,
timeout: number = 30_000): Promise<void> {
await this.driver.waitUntil(
async () => {
const largeVideoResource = await this.getLargeVideo().getResource();
return expectedEndpointIds.includes(largeVideoResource);
},
{
timeout,
timeoutMsg: timeoutMsg || `Expected one of [${expectedEndpointIds.join(', ')}] on large video for ${this.name}`
});
}
/**
* Returns the videoQuality Dialog.
*

View File

@@ -13,16 +13,6 @@ describe('Active speaker', () => {
const { p1, p2, p3 } = ctx;
// Exit tile view to enter stage view (default for 3 participants is tile view)
await p1.getToolbar().clickExitTileViewButton();
await p1.waitForTileViewDisplayed(true);
await p2.getToolbar().clickExitTileViewButton();
await p2.waitForTileViewDisplayed(true);
await p3.getToolbar().clickExitTileViewButton();
await p3.waitForTileViewDisplayed(true);
await muteAudioAndCheck(p1, p2);
await muteAudioAndCheck(p2, p1);
await muteAudioAndCheck(p3, p1);
@@ -41,124 +31,6 @@ describe('Active speaker', () => {
await assertOneDominantSpeaker(p2);
await assertOneDominantSpeaker(p3);
});
it('testLocalDominantSpeakerShowsLastRemote', async () => {
await ensureThreeParticipants();
const { p1, p2, p3 } = ctx;
const p2EndpointId = await p2.getEndpointId();
const p3EndpointId = await p3.getEndpointId();
// p2 speaks first
await p2.getToolbar().clickAudioUnmuteButton();
await p1.waitForParticipantOnLargeVideo(p2EndpointId, 'P2 not displayed as dominant speaker on P1');
await p2.getToolbar().clickAudioMuteButton();
// p3 speaks second
await p3.getToolbar().clickAudioUnmuteButton();
await p1.waitForParticipantOnLargeVideo(p3EndpointId, 'P3 not displayed as dominant speaker on P1');
await p3.getToolbar().clickAudioMuteButton();
// Now p1 starts screenshare and becomes dominant speaker
await p1.getToolbar().clickDesktopSharingButton();
// p1 should see p3 (last remote dominant speaker) on stage
await p1.getToolbar().clickAudioUnmuteButton();
await p1.waitForParticipantOnLargeVideo(p3EndpointId, 'P1 should see P3 (last remote speaker) on stage when local is dominant');
// Check that p2 and p3 tiles remain visible in filmstrip on p1
await p1.driver.$(`//span[@id='participant_${p2EndpointId}']`).waitForDisplayed({
timeout: 3_000,
timeoutMsg: 'P2 tile should remain visible in filmstrip during screenshare'
});
await p1.driver.$(`//span[@id='participant_${p3EndpointId}']`).waitForDisplayed({
timeout: 3_000,
timeoutMsg: 'P3 tile should remain visible in filmstrip during screenshare'
});
// Check that there are no gaps in the filmstrip during local screenshare
await p2.getFilmstrip().assertNoGapsInFilmstrip();
await p3.getFilmstrip().assertNoGapsInFilmstrip();
await p1.getToolbar().clickAudioMuteButton();
await p1.getToolbar().clickStopDesktopSharingButton();
});
it('testAlternatingLocalAndRemoteDominantSpeaker', async () => {
await ensureThreeParticipants();
const { p1, p2, p3 } = ctx;
const p2EndpointId = await p2.getEndpointId();
const p3EndpointId = await p3.getEndpointId();
// Test alternating pattern: p2 -> p1 (local) -> p3 -> p1 (local) -> p2
// This tests that local dominant speaker consistently shows last remote speaker
// p2 speaks
await p2.getToolbar().clickAudioUnmuteButton();
await p1.waitForParticipantOnLargeVideo(p2EndpointId, 'P2 not shown on P1');
await p2.getToolbar().clickAudioMuteButton();
// p1 (local) speaks - should still show p2
await p1.getToolbar().clickAudioUnmuteButton();
await p1.waitForParticipantOnLargeVideo(p2EndpointId, 'P1 local dominant should show P2 (last remote)');
await p1.getToolbar().clickAudioMuteButton();
// p3 speaks
await p3.getToolbar().clickAudioUnmuteButton();
await p1.waitForParticipantOnLargeVideo(p3EndpointId, 'P3 not shown on P1');
await p3.getToolbar().clickAudioMuteButton();
// p1 (local) speaks again - should now show p3
await p1.getToolbar().clickAudioUnmuteButton();
await p1.waitForParticipantOnLargeVideo(p3EndpointId, 'P1 local dominant should show P3 (last remote)');
await p1.getToolbar().clickAudioMuteButton();
// p2 speaks again
await p2.getToolbar().clickAudioUnmuteButton();
await p1.waitForParticipantOnLargeVideo(p2EndpointId, 'P2 not shown on P1 after second speak');
await p2.getToolbar().clickAudioMuteButton();
// p1 (local) speaks - should show p2 again
await p1.getToolbar().clickAudioUnmuteButton();
await p1.waitForParticipantOnLargeVideo(p2EndpointId, 'P1 local dominant should show P2 (last remote) again');
await p1.getToolbar().clickAudioMuteButton();
});
it('testDominantSpeakerWithSimultaneousSpeakers', async () => {
await ensureThreeParticipants();
const { p1, p2, p3 } = ctx;
const p2EndpointId = await p2.getEndpointId();
const p3EndpointId = await p3.getEndpointId();
// Multiple participants unmute simultaneously (this is the scenario we're testing)
await p2.getToolbar().clickAudioUnmuteButton();
await p3.getToolbar().clickAudioUnmuteButton();
// Wait for one to become dominant (bridge will pick one)
await p1.waitForAnyParticipantOnLargeVideo(
[ p2EndpointId, p3EndpointId ],
'No dominant speaker detected when multiple speak simultaneously');
// Get which one was selected as dominant
const firstDominant = await p1.getLargeVideo().getResource();
// Mute both
await Promise.all([
p2.getToolbar().clickAudioMuteButton(),
p3.getToolbar().clickAudioMuteButton()
]);
// Now p1 becomes local dominant speaker
// Should show the last remote dominant speaker (firstDominant)
await p1.getToolbar().clickAudioUnmuteButton();
await p1.waitForParticipantOnLargeVideo(
firstDominant,
'Local dominant should show last remote dominant after simultaneous speakers');
await p1.getToolbar().clickAudioMuteButton();
});
});
/**
@@ -191,12 +63,14 @@ async function testActiveSpeaker(
await activeSpeaker.getFilmstrip().assertAudioMuteIconIsDisplayed(activeSpeaker, true);
// Verify that the user is now an active speaker from otherParticipant1's perspective
await otherParticipant1.waitForParticipantOnLargeVideo(speakerEndpoint,
`Active speaker ${activeSpeaker.name} not displayed on large video.`,
30_000); // 30 seconds
await otherParticipant2.waitForParticipantOnLargeVideo(speakerEndpoint,
`Active speaker ${activeSpeaker.name} not displayed on large video.`,
30_000); // 30 seconds
const otherParticipant1Driver = otherParticipant1.driver;
await otherParticipant1Driver.waitUntil(
async () => await otherParticipant1.getFilmstrip().isDominantSpeaker(speakerEndpoint),
{
timeout: 30_000, // 30 seconds
timeoutMsg: `${activeSpeaker.name} is not selected as active speaker.`
});
// just a debug print to go in logs
await activeSpeaker.log('Muting in testActiveSpeaker');

View File

@@ -175,6 +175,11 @@ describe('Start muted', () => {
await p1.getParticipantsPane().assertVideoMuteIconIsDisplayed(p2);
await p2.getParticipantsPane().assertVideoMuteIconIsDisplayed(p1);
await Promise.all([
p1.getLargeVideo().waitForSwitchTo(await p2.getEndpointId()),
p2.getLargeVideo().waitForSwitchTo(await p1.getEndpointId())
]);
await unmuteVideoAndCheck(p2, p1);
await p1.getLargeVideo().assertPlaying();
});