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

Remote screenshare support #66

Merged
merged 3 commits into from
Sep 7, 2023
Merged

Conversation

thyal
Copy link
Member

@thyal thyal commented Sep 6, 2023

This adds support for rendering remote screenshares, with a new property on the state object, containing a list of active screenshares. This allows you to render screenshares separately from normal videos:

 const { remoteParticipants, screenshares } = state;
 
       {remoteParticipants.map((p) => (
        <VideoView key={p.id} stream={p.stream} />
      ))}

      {screenshares.map((s) => (
        <VideoView key={s.id} stream={s.stream} />
      ))}

The screenshares are also added as a stream in the streams array of the remote participant - and there's some cleanup to the addStream functionality. This fixes the bug where we render the screenshare as a participant stream if you join a room with the SDK where a screenshare is already active.

Local screenshare (render/start/stop) is not handled in this PR, it will come in a follow-up.

Screenshares are currently shown twice - this is because of a known bug with the event listeners.

Test plan

  1. Add the relevant code to you SDK test app - as shown above
  2. Join a room with an sdk client and a remote participant
  3. Start a screenshare with the remote participant, you should see the screenshare rendered in the SDK app
  4. Leave and join again with the SDK app - you should see both the video and screenshare view from the remote participant
  5. Stop screenshare, it should go away and the video of the remote participant should stay.

src/lib/RoomConnection.ts Show resolved Hide resolved
src/lib/RoomParticipant.ts Outdated Show resolved Hide resolved
src/lib/RoomConnection.ts Show resolved Hide resolved
Copy link
Collaborator

@nandito nandito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works pretty well, I only found 1 thing that should be fixed before merging.

src/lib/RoomConnection.ts Show resolved Hide resolved
src/lib/RoomConnection.ts Outdated Show resolved Hide resolved
@thyal thyal force-pushed the thomas/PAN-252-screenshare-support branch from 01ef691 to a20f064 Compare September 7, 2023 08:22
@thyal thyal merged commit 8a9b3d0 into development Sep 7, 2023
1 check passed
@thyal thyal deleted the thomas/PAN-252-screenshare-support branch September 7, 2023 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants