Skip to content

Conversation

@ADARSHsri2004
Copy link
Contributor

Description

This PR adds full screen sharing support to the PeerCall application for one-to-one WebRTC calls.
The feature is implemented entirely within the InRoom.tsx file and integrates smoothly with the existing WebRTC + Socket.IO signaling architecture.

Key Features Implemented

  1. Screen Sharing
  • Added ability for a user to share their screen during a call using navigator.mediaDevices.getDisplayMedia().
  • The shared screen replaces the camera video stream in the active RTCPeerConnection.
  • When screen sharing stops (either manually or through browser “Stop sharing”), the app automatically switches back to the user’s camera stream.
  1. Stream Replacement Logic
  • Implemented proper sender.replaceTrack() logic to dynamically switch between:
  • Camera video track
  • Screen share video track
  • No renegotiation required; remote peer immediately receives the updated video track
  1. Stable One-to-One WebRTC Flow
  • Cleaned and simplified entire 1:1 call pipeline:
  • Local media capture
  • PeerConnection creation
  • Offer/Answer exchange
  • ICE candidate exchange
  • Remote track event handling
  1. UI Updates
  • Added clear buttons for:
  • Start Screen Share
  • Stop Screen Share
  • Updated local video tile to visually reflect when screen sharing is active.
image

Semver Changes

  • Patch (bug fix, no new features)
  • Minor (new features, no breaking changes)
  • Major (breaking changes)

Issues

Closes #4

Checklist

@04shubham7 04shubham7 merged commit 75819d0 into OPCODE-Open-Spring-Fest:main Nov 14, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Screen Sharing Support

2 participants