Skip to content

feat: Voice Call - Native Screen Sharing#37922

Merged
ggazzo merged 80 commits intodevelopfrom
poc/videoSharing
Mar 19, 2026
Merged

feat: Voice Call - Native Screen Sharing#37922
ggazzo merged 80 commits intodevelopfrom
poc/videoSharing

Conversation

@gabriellsh
Copy link
Copy Markdown
Member

@gabriellsh gabriellsh commented Dec 22, 2025

Proposed changes (including videos or screenshots)

Just a tinkering branch for now.
Now an official project 😄

image image

Issue(s)

CORE-1902

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • New Features

    • Screen sharing in calls: local/remote screen views, start/stop controls, indicators, and per-call UI (peer/stream cards, action strip with chat toggle and device picker).
    • Improved in-room call experience: integrated media call room view and widget behavior to hide popup when in-room.
  • Chores

    • Added localization for screen-sharing and chat controls.
    • New VoIP setting to enable/disable screen sharing and per-user feature checks.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Dec 22, 2025

🦋 Changeset detected

Latest commit: a3ca653

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 43 packages
Name Type
@rocket.chat/meteor Minor
@rocket.chat/i18n Minor
@rocket.chat/media-signaling Minor
@rocket.chat/ui-voip Major
@rocket.chat/media-calls Minor
@rocket.chat/mock-providers Patch
@rocket.chat/ui-contexts Major
@rocket.chat/web-ui-registration Major
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/core-services Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/ui-client Major
@rocket.chat/uikit-playground Patch
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-video-conf Major
@rocket.chat/queue-worker Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/presence-service Patch
@rocket.chat/abac Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/cron Patch
@rocket.chat/http-router Patch
@rocket.chat/model-typings Patch
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/models Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/server-fetch Patch

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 22, 2025

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds 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

Cohort / File(s) Summary
Server settings & media-call service
apps/meteor/ee/server/settings/voip.ts, apps/meteor/server/services/media-call/service.ts, ee/packages/media-calls/src/definition/IMediaCallServer.ts, ee/packages/media-calls/src/server/MediaCallServer.ts, ee/packages/media-calls/src/server/getDefaultSettings.ts
Add screen-sharing setting and per-user feature gate; introduce isFeatureAvailableForUser(uid, feature) and wire into defaults and service.
Call creation
ee/packages/media-calls/src/server/CallDirector.ts
Filter call features at creation using isFeatureAvailableForUser, store allowed features on the call.
Media-signaling definitions
packages/media-signaling/src/definition/... (call/CallEvents.ts, call/IClientMediaCall.ts, media/IMediaStreamManager.ts, services/webrtc/IWebRTCProcessor.ts, index.ts, services/negotiation.ts)
Expose screen-share feature and new events/methods: screenShareRequestChange, activeTimestamp, screen-related stream fields, IWebRTCProcessor screenVideoTrack API; remove INegotiationCompatibleMediaCall.
Media-signaling implementation
packages/media-signaling/src/lib/... (Call.ts, NegotiationManager.ts, media/MediaStreamManager.ts, services/webrtc/Processor.ts, Session.ts, index.ts)
Implement screenVideoTrack lifecycle, requestScreenShare API, activeTimestamp, negotiation gating via hasAllRequiredTracks, displayMediaFactory plumbing, and WebRTC processor updates.
UI: contexts & providers
packages/ui-voip/src/context/*, packages/ui-voip/src/providers/* (MediaCallInstanceContext.ts, MediaCallViewContext.ts, MediaCallInstanceProvider.tsx, MediaCallViewProvider.tsx, MockedMediaCallProvider.tsx)
Add inRoomView/setInRoomView to instance context; expose streams, onToggleScreenSharing, and widgetPositionTracker in view context; update providers and mocks.
UI: hooks & playback
packages/ui-voip/src/providers/*, packages/ui-voip/src/hooks/* (usePlayMediaStream.ts, useAudioStream.ts, useScreenShareStreams.ts, useWidgetPositionTracker.ts, useRoomView.ts, usePeekMediaSessionFeatures.tsx, useDraggable changes)
Add playback hook, audio extractor, screen-share stream tracker, widget position tracker, room-view lifecycle hook, peek-features hook; extend draggable hook to accept restore/onChange callbacks.
UI: components & views (cards/actions/room/widget)
packages/ui-voip/src/components/Cards/*, packages/ui-voip/src/components/Actions/*, packages/ui-voip/src/views/MediaCallRoomSection/*, packages/ui-voip/src/views/MediaCallWidget/*, apps/meteor/client/views/room/...
Add Card system (PeerCard, StreamCard, lists), ActionStrip/ActionToggleChat, MediaCallRoomActivity and MediaCallRoomSection views, OngoingCallWithScreen, wrap RoomBody with MediaCallRoom, and layout tweak (maxHeight).
Client provider adjustment
apps/meteor/client/providers/MediaCallProvider.tsx, packages/ui-voip/src/providers/MediaCallInstanceProvider.tsx
Expand unauthorized/instance context shapes to include inRoomView/setInRoomView; switch audio wiring to useAudioStream.
Exports, barrels & i18n
packages/ui-voip/src/index.ts, packages/ui-voip/src/components/index.ts, packages/ui-voip/src/views/index.ts, packages/i18n/src/locales/en.i18n.json, packages/media-signaling/.eslintrc.json
Expose new modules via barrels, add translation keys for chat/screen-sharing labels, add ESLint config for media-signaling.
Tests & minor tweaks
packages/ui-voip/src/*spec.tsx, miscellaneous small edits
Update tests/mocks to include new context fields; small comments, typing and storybook tweaks.

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
Loading
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()
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • tassoevan
  • ggazzo
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: Voice Call - Native Screen Sharing' clearly and concisely summarizes the primary change—implementing native screen sharing for voice calls, which aligns with the extensive changeset across UI, signaling, and service components.
Linked Issues check ✅ Passed The PR implements comprehensive screen sharing functionality including UI components, media signaling support, server-side feature controls, and context management. All coding requirements for native screen sharing are addressed.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing screen sharing: UI components for screen sharing controls, media stream handling, WebRTC processor updates, feature permission checking, and context/state management. No unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 22, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.1GiB 1.1GiB +11MiB
rocketchat 360MiB 349MiB +11MiB
omnichannel-transcript-service 134MiB 134MiB +11KiB
queue-worker-service 134MiB 134MiB +8.8KiB
ddp-streamer-service 128MiB 128MiB +9.2KiB
account-service 115MiB 115MiB +8.6KiB
authorization-service 112MiB 112MiB +11KiB
presence-service 112MiB 112MiB +12KiB

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 21:00", "12/04 18:17", "12/05 21:56", "12/08 20:15", "12/09 22:17", "12/10 23:26", "12/11 21:56", "12/12 22:45", "12/13 01:34", "12/15 22:31", "12/16 22:18", "12/17 21:04", "12/18 23:12", "12/19 23:27", "12/20 21:03", "12/22 18:54", "12/23 16:16", "12/24 19:38", "12/25 17:51", "12/26 13:18", "12/29 19:01", "12/30 20:52", "02/12 22:57", "02/13 15:52", "02/13 16:18 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12]
  line "omnichannel-transcript-service" [0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "rocketchat" [0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.35]
Loading

Statistics (last 30 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.4GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 1.1GiB
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-37922
  • Baseline: develop
  • Timestamp: 2026-02-13 16:18:45 UTC
  • Historical data points: 30

Updated: Fri, 13 Feb 2026 16:18:46 GMT

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 43.91026% with 350 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.43%. Comparing base (4f88165) to head (a3ca653).
⚠️ Report is 22 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
e2e 60.41% <47.61%> (+<0.01%) ⬆️
e2e-api 48.13% <0.00%> (-0.11%) ⬇️
unit 70.91% <44.22%> (-0.68%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Dec 29, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@gabriellsh gabriellsh changed the title chore: POC media calling Video/screen sharing feat: Media Call - Screen Sharing Mar 2, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

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.

@gabriellsh gabriellsh added the stat: QA assured Means it has been tested and approved by a company insider label Mar 18, 2026
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Mar 18, 2026
@dionisio-bot dionisio-bot bot enabled auto-merge March 18, 2026 18:10
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

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.

@dionisio-bot dionisio-bot bot added this pull request to the merge queue Mar 19, 2026
@ggazzo ggazzo removed this pull request from the merge queue due to a manual request Mar 19, 2026
@ggazzo ggazzo merged commit 1741a20 into develop Mar 19, 2026
46 checks passed
@ggazzo ggazzo deleted the poc/videoSharing branch March 19, 2026 22:53
Jashk120 pushed a commit to Jashk120/Rocket.Chat that referenced this pull request Mar 20, 2026
ggazzo pushed a commit that referenced this pull request Mar 25, 2026
ggazzo pushed a commit that referenced this pull request Mar 25, 2026
Jashk120 pushed a commit to Jashk120/Rocket.Chat that referenced this pull request Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: feature Pull requests that introduces new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants