Skip to content

Conversation

@santhoshvai
Copy link
Member

💡 Overview

Bug on RN: use camera.flip() to move to rear camera then use camera.toggle() to switch it off, now toggle() it comes back as front camera, but the expectation is to see rear camera

📝 Implementation notes

Just deselect the device after applying constraints; the native side takes care of the device persistence.

Copy link
Contributor

Copilot AI left a 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 fixes a bug in React Native where camera flip() followed by toggle() operations would incorrectly return to the front camera instead of maintaining the previously selected rear camera.

  • Removes device direction state updates after applying constraints for camera flip
  • Adds React Native-specific handling to prevent unnecessary track operations after device deselection

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@oliverlaz oliverlaz merged commit 2703121 into main Oct 17, 2025
18 checks passed
@oliverlaz oliverlaz deleted the camera-toggle branch October 17, 2025 11:38
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