Skip to content

fix: only render RTCView once stream has a video track - #2331

Merged
santhoshvai merged 1 commit into
mainfrom
fix-video-sub
Jul 13, 2026
Merged

fix: only render RTCView once stream has a video track#2331
santhoshvai merged 1 commit into
mainfrom
fix-video-sub

Conversation

@santhoshvai

@santhoshvai santhoshvai commented Jul 13, 2026

Copy link
Copy Markdown
Member

💡 Overview

Native RTCView does not observe about late arriving tracks. So a local video which may have empty video track initially would always not render the actual video track after it arrives later. This PR fixes that.

📝 Implementation notes

We just render RTCView after video track is present

🎫 Ticket: https://linear.app/stream/issue/XYZ-123

📑 Docs: https://github.com/GetStream/docs-content/pull/

Summary by CodeRabbit

  • Bug Fixes
    • Improved video rendering by ensuring a media stream contains a video track before displaying it.
    • Prevented unnecessary iOS screenshot registration when no video track is available.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d33024b2-0c05-4089-bd6e-f65b51291ea7

📥 Commits

Reviewing files that changed from the base of the PR and between 88d5e97 and 1a378b6.

📒 Files selected for processing (1)
  • packages/react-native-sdk/src/components/Participant/ParticipantView/VideoRenderer/index.tsx

📝 Walkthrough

Walkthrough

VideoRenderer now requires the selected MediaStream to contain a video track before rendering video or registering iOS screenshots.

Changes

VideoRenderer visibility

Layer / File(s) Summary
Require a video track
packages/react-native-sdk/src/components/Participant/ParticipantView/VideoRenderer/index.tsx
canShowVideo now checks for at least one video track in the selected stream, also gating dependent iOS screenshot registration.

Estimated code review effort: 2 (Simple) | ~5 minutes

Suggested reviewers: oliverlaz, copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: delaying RTCView rendering until a video track exists.
Description check ✅ Passed The description includes the required Overview and Implementation notes sections plus ticket and docs links.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-video-sub

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the React Native SDK’s VideoRenderer to avoid mounting RTCView until the underlying MediaStream actually contains a video track, addressing the issue where RTCView doesn’t react to tracks that arrive after initial render.

Changes:

  • Added a hasVideoTrackInStream guard (getVideoTracks().length > 0) to ensure RTCView is only rendered once a video track is present.
  • Updated canShowVideo to depend on track presence (in addition to existing visibility/publishing/paused/setting checks).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

Copy link
Copy Markdown

Bundle size

Built package output. Sizes in KB; delta vs main@88d5e97.

Package Unminified Minified Δ min vs main
@stream-io/video-react-native-sdk 401.4 KB 192.1 KB +29 B (+0.0%)
↳ install total (+ client + react-bindings) 1173.4 KB 464.3 KB +29 B (+0.0%)

@santhoshvai
santhoshvai merged commit 70cb902 into main Jul 13, 2026
12 checks passed
@santhoshvai
santhoshvai deleted the fix-video-sub branch July 13, 2026 12:19
@github-actions

Copy link
Copy Markdown

🎉 The changes from this pull request have been released.

Shipped with:

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.

3 participants