Skip to content
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

switchCameraPosition on CameraCapturer causes the VideoView to be flipped horizontally for split of a second #362

Closed
patryk-sredzinski opened this issue Apr 5, 2024 · 2 comments · Fixed by #366
Assignees
Labels
bug Something isn't working

Comments

@patryk-sredzinski
Copy link
Contributor

patryk-sredzinski commented Apr 5, 2024

Describe the bug
When you want to switch camera between front and rear camera, VideoView shows frame flipped horizontally.

SDK Version
2.0.5

iOS/macOS Version
iPhone 15 Pro, iOS 17.5

Minimal Example code
I've made a few changes to uikit-minimal repository to show this effect.

branch:
bug/switch-camera-position-flipped-horizontally

PR showing the changes:
https://github.com/patryk-sredzinski/client-sdk-swift/pull/1/files

Steps to Reproduce

  1. Create LocalVideoTrack
  2. Create VideoView
  3. Start LocalVideoTrack
  4. Set VideoView's track to LocalVideoTrack
  5. Execute switchCameraPosition on LocalVideoTrack's capturer
  6. Observe
// If this myVideoTrack is added to a videoView, the ugly mirror/horizontal flip occours 
try await (myVideoTrack.capturer as? CameraCapturer)?.switchCameraPosition()

Expected behavior
VideoView should probably just keep the last valid frame, and flip only when new frame from new camera is available

Screenshots
output

This just looks bad and breaks a nice user experience.
or maybe I am doing something wrong here?

@patryk-sredzinski patryk-sredzinski added the bug Something isn't working label Apr 5, 2024
@hiroshihorie
Copy link
Member

Thanks I have noticed this too. It needs some timing tweaking etc.

@hiroshihorie
Copy link
Member

Further improvements in this PR:
#383

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants