feat: Voice Call - Native Screen Sharing#37922
Conversation
🦋 Changeset detectedLatest commit: a3ca653 The changes in this PR will be included in the next version bump. This PR includes changesets to release 43 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds screen-sharing support and room-view tracking across signaling, server feature gating, hooks, providers, contexts, and UI: new screen-share APIs and tracks, server per-user feature checks, widget position persistence, MediaCall room/activity components, Card/Action UI pieces, and context fields for in-room view and streams. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant RoomView
participant MediaCallRoom
participant MediaCallRoomActivity
participant MediaCallViewProvider
participant MediaSignalingSession
participant WebRTCProcessor
User->>RoomView: open DM room
RoomView->>MediaCallRoom: render children
MediaCallRoom->>MediaSignalingSession: peek session & peerInfo
alt session ongoing & screen-share enabled & valid peer
MediaCallRoom->>MediaCallRoomActivity: render activity wrapper
MediaCallRoomActivity->>MediaCallViewProvider: mount (provide streams, onToggle)
User->>MediaCallRoomActivity: click "Share screen"
MediaCallViewProvider->>MediaSignalingSession: controls.toggleScreenSharing()
MediaSignalingSession->>WebRTCProcessor: setScreenVideoTrack(displayStream)
WebRTCProcessor->>MediaSignalingSession: emit screen-share.start
MediaSignalingSession->>MediaCallViewProvider: screenShareRequestChange
MediaCallViewProvider->>RoomView: update streams in context
RoomView->>User: show StreamCard(s)
else
MediaCallRoom->>RoomView: render children unchanged
end
sequenceDiagram
participant Client
participant MediaCallViewProvider
participant useScreenShareStreams
participant MediaSignalingSession
participant WebRTCProcessor
Client->>MediaCallViewProvider: mount provider(instance)
MediaCallViewProvider->>useScreenShareStreams: call with instance
useScreenShareStreams->>MediaSignalingSession: subscribe sessionStateChange
MediaSignalingSession-->>useScreenShareStreams: sessionStateChange
useScreenShareStreams->>MediaSignalingSession: read mainCall.streams
MediaSignalingSession->>WebRTCProcessor: expose stream wrappers
useScreenShareStreams->>MediaCallViewProvider: update streams state
MediaCallViewProvider->>Client: expose streams & onToggleScreenSharing
Client->>MediaCallViewProvider: onToggleScreenSharing()
MediaCallViewProvider->>MediaSignalingSession: controls.toggleScreenSharing()
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #37922 +/- ##
===========================================
- Coverage 70.91% 70.43% -0.48%
===========================================
Files 3209 3245 +36
Lines 113893 115175 +1282
Branches 20689 20932 +243
===========================================
+ Hits 80765 81127 +362
- Misses 31071 31992 +921
+ Partials 2057 2056 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Looks like this PR is ready to merge! 🎉 |
f59b181 to
72cf705
Compare
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/meteor/server/services/media-call/service.ts">
<violation number="1" location="apps/meteor/server/services/media-call/service.ts:331">
P1: Keep the fallback deny-by-default here. Returning `true` now whitelists unhandled call features like `transfer` and `hold` for every user.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
1 issue found across 6 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/ui-voip/src/providers/useMediaSessionInstance.ts">
<violation number="1" location="packages/ui-voip/src/providers/useMediaSessionInstance.ts:95">
P2: Guard `navigator.mediaDevices` itself before reading `getDisplayMedia`, otherwise unsupported/insecure contexts still crash with a `TypeError` here.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/meteor/tests/e2e/voice-calls-ee.spec.ts">
<violation number="1" location="apps/meteor/tests/e2e/voice-calls-ee.spec.ts:30">
P2: Don't hardcode the cleanup value for this global setting; restore the original state instead. Otherwise this suite can leak `VoIP_TeamCollab_Screen_Sharing_Enabled=true` into later E2E tests or local runs that started with it disabled.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Co-authored-by: Pierre Lehnen <[email protected]>
Co-authored-by: Pierre Lehnen <[email protected]>
Co-authored-by: Pierre Lehnen <[email protected]>
Co-authored-by: Pierre Lehnen <[email protected]>
Proposed changes (including videos or screenshots)
Just a tinkering branch for now.Now an official project 😄
Issue(s)
CORE-1902
Steps to test or reproduce
Further comments
Summary by CodeRabbit
New Features
Chores