-
Notifications
You must be signed in to change notification settings - Fork 38
fix: keep objectfit as cover for floating video view #1849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
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 ensures the video’s objectFit
behavior remains stable by waiting for valid frame dimensions before rendering and defaulting floating participant views to cover
.
- Simplified
useTrackDimensions
hook: removed localgetSettings()
logic and unified on-call stats for all participants. - Updated
VideoRenderer
to gate rendering on valid dimensions or an explicitobjectFit
prop. - Defaulted
objectFit="cover"
for floating participant views inCallContent
.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/react-native-sdk/src/hooks/useTrackDimensions.ts | Removed trackType param and getSettings() effect; use call stats for all. |
packages/react-native-sdk/src/components/Participant/ParticipantView/VideoRenderer.tsx | Added isVideoDimensionsValid check and integrated objectFit gating. |
packages/react-native-sdk/src/components/Call/CallContent/CallContent.tsx | Passed objectFit="cover" to floating ParticipantView . |
Comments suppressed due to low confidence (1)
packages/react-native-sdk/src/hooks/useTrackDimensions.ts:32
- [nitpick] Consider adding unit tests for
useTrackDimensions
to verify that it correctly updates dimensions based on call stats, especially covering transitions from zero to non-zero values.
useEffect(() => {
packages/react-native-sdk/src/components/Participant/ParticipantView/VideoRenderer.tsx
Outdated
Show resolved
Hide resolved
packages/react-native-sdk/src/components/Participant/ParticipantView/VideoRenderer.tsx
Outdated
Show resolved
Hide resolved
…ntView/VideoRenderer.tsx Co-authored-by: Copilot <[email protected]>
💡 Overview
In this PR,
⏩ Next iteration - TODO
Next, We should wait for dimensions to be valid to render the video element.
If we wait now, the delay is 2 seconds for rtc stats to appear, this makes the video component render after an unnecessary delay.
We will next add a native event listener webrtc level to send dimensions change update. Then add this mechanism.