Skip to content

Conversation

@TinhHuynh
Copy link
Contributor

@TinhHuynh TinhHuynh commented Mar 29, 2024


🎯 Goal

Improve user experience by ensuring the video orientation matches user expectations. The change prevents mirroring for local back camera video streams, making the display more intuitive, especially in contexts where mirroring could confuse or degrade the viewing experience.

🛠 Implementation details

Modified the StreamVideoRenderer class to detect if a video stream is local and from the back camera. If these conditions are met, the video is not mirrored. This involved checking the videoTrack's mediaConstraints.facingMode against FacingMode.environment to identify back camera usage and adjusting the mirror variable accordingly.

🎨 UI Changes

Before After
Before Image After Image

🧪 Testing

  1. Test with front camera to ensure existing mirroring behavior remains unaffected.
  2. Switch to the back camera and confirm that mirroring is disabled.

This change targets the video rendering behavior, requiring live testing with video streams from both front and back cameras to validate the implementation.

☑️ Contributor Checklist

  • Assigned code owner
  • Initiated discussion in Slack channel
  • Linked PR to GitHub issue

☑️ Reviewer Checklist

  • Ensured functionality works as expected
  • Verified no UI regressions
  • Confirmed new feature operates correctly
  • Reviewed documentation for accuracy

@TinhHuynh TinhHuynh requested a review from a team as a code owner March 29, 2024 17:25
@d3xvn
Copy link
Contributor

d3xvn commented Apr 5, 2024

Hey @TinhHuynh 👋 , thanks for the contribution to the repo! I added a simple change that also stops mirroring the Screenshare track.

@TinhHuynh
Copy link
Contributor Author

Hi @deven98
Thanks for reviewing and correcting the code!

@d3xvn d3xvn enabled auto-merge (squash) April 5, 2024 14:37
@d3xvn d3xvn disabled auto-merge April 5, 2024 14:37
@d3xvn d3xvn merged commit 34f2185 into GetStream:main Apr 5, 2024
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.

2 participants