fix: allow screen sharing without media devices
Proposed changes (including videos or screenshots)
This PR allows users to share their screen even when a microphone or camera is not available.
Previously, screen sharing depended on having a local audio input track available. Users without media devices could receive calls and view shared screens, but they could not start their own screen sharing.
This change:
- Allows calls to continue without an available microphone input track.
- Allows WebRTC negotiation without requiring a local audio track.
- Handles screen sharing as a separate media track.
- Enables users without camera/microphone devices to start and share their screen.
Issue(s)
Fixes #1745
Steps to test or reproduce
-
Use two clients:
- Client A with microphone/camera available.
- Client B without microphone/camera available.
-
Start a media call from Client A to Client B.
-
Accept the call from Client B.
-
From Client B, start screen sharing.
-
Verify that Client A can see Client B's shared screen.
-
Stop screen sharing and verify that the call continues normally.
Further comments
This implementation keeps audio input and screen sharing as separate media concerns. Missing microphone/camera devices should no longer prevent users from participating in calls or sharing their screen.
Summary by CodeRabbit
-
New Features
- Added screen-sharing controls and status indicators for voice and video calls.
- Added support for muting and placing calls on hold.
- Calls can now be accepted without microphone access.
-
Bug Fixes
- Improved call setup when no microphone or audio track is available.
- Prevented failed microphone access from unnecessarily ending calls.
- Improved audio handling during held and receive-only calls.
- Added validation for call control messages to improve reliability.
- Standardized messaging when microphone access fails.