fix: only render RTCView once stream has a video track - #2331
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesVideoRenderer visibility
Estimated code review effort: 2 (Simple) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
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
hasVideoTrackInStreamguard (getVideoTracks().length > 0) to ensureRTCViewis only rendered once a video track is present. - Updated
canShowVideoto 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.
Bundle sizeBuilt package output. Sizes in KB; delta vs
|
|
🎉 The changes from this pull request have been released. Shipped with:
|
💡 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