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 Sharing stream while answering a call has 3 tracks - (audio, camera and screen) but the call.on("stream", callback) receives only 2 tracks #1152

Open
nayak2002 opened this issue Nov 9, 2023 · 0 comments
Labels
client related to peerjs client

Comments

@nayak2002
Copy link

nayak2002 commented Nov 9, 2023

I have developed a video conferencing app using vuejs for frontend, and peerjs for peer mesh connection.
The issue is that when a user starts to share their screen, all the users connected in the call receive the stream but when a new user joins while a user is sharing their screen then the screen share is not shown.

image
This is the stream I sent while answering the call from the new user, you can clearly see the 2 video tracks and the 1 audio track.

const screenShare = navigator.mediaDevices.getDisplayMedia(options);
screenShare.then((stream) => {
this.localUser.stream.addTrack(stream.getVideoTracks()[0]);

This is how I am adding the screen video track to the existing stream, before calling.
I have not given the entire codebase, but if you have any questions, Do ask!

image
These are the local tracks for the new user and tracks from the user answering the call.

As you can see I am sending 3 tracks while answering but I'm getting only 2 tracks for the new user.
I would really appreciate any recommendations/solutions.

@irgalamarr irgalamarr added the client related to peerjs client label Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client related to peerjs client
Projects
None yet
Development

No branches or pull requests

2 participants