Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen share - Main participant display in an infinite loop #213

Closed
ppavanpasupuleti opened this issue May 19, 2020 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@ppavanpasupuleti
Copy link

On clicking the screen share button and select "Your Entire Screen" option on the share screen dialog (ScreenShot 1) the main participant display goes in an infinite loop screen capture as shown in the screenshot (ScreenShot 2) .

Reproducible all the time with twilio-video-app-react app.

The other options like "Application and chrome tab" sharing works perfectly fine.
ScreenShot 1:
image

ScreenShot 2:
image

@ppavanpasupuleti ppavanpasupuleti added the bug Something isn't working label May 19, 2020
@shaibt
Copy link

shaibt commented May 21, 2020

Hi,

Had the same issue - this isn't a bug per se.
The default behaviour of the app is that when a participant is screen sharing, they see their own screen share as their MainParticipant video track so they're sharing what they are viewing and viewing what they are sharing.....infinite loop.

The behaviour is set in the hook useMainSpeaker which is the logic that determines which participant to display as Main.

If you want to be able to share the the video app's window in screen share you have to check that the screen sharing participant isn't the local participant. Would look something like:

// if the screen share participant is local, don't choose them as main participant
const filteredScreenShareParticipant = localParticipant !== screenShareParticipant ? screenShareParticipant : undefined;
return selectedParticipant || filteredScreenShareParticipant || dominantSpeaker || participants[0] || localParticipant;

@timmydoza
Copy link
Contributor

Thanks for the issue @ppavanpasupuleti!

@shaibt is right - this isn't a bug. It's by design that a user see's their own screen when sharing. Normally they would share a different window (or screen), and they could look at the app to verify what they are sharing.

If the above effect is undesirable, then I'd recommend @shaibt's suggestion above. The useMainSpeaker hook can be modified so the user doesn't see their own screen when screensharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants