Skip to content

Conversation

@hiroshihorie
Copy link
Member

@hiroshihorie hiroshihorie commented Jan 30, 2026

Fixes: #863

  • Fix camera switching by comparing against the pre-update device id when deciding to call switchCamera.
  • Keep room options updated for future tracks while still allowing the active track to change devices.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where switching the camera could fail; the app now correctly detects and switches the active video input device.
    • Added a changelog entry noting the patch that resolves camera switching behavior.

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

The device-comparison in RoomHardwareManagementMethods.setVideoInputDevice was changed to compare the new device against the room's active camera deviceId (engine.roomOptions.defaultCameraCaptureOptions.deviceId) instead of the previously used selectedVideoInputDeviceId.

Changes

Cohort / File(s) Summary
Device Comparison Logic
lib/src/core/room.dart
Replaced comparison of selectedVideoInputDeviceId with currentDeviceId (engine.roomOptions.defaultCameraCaptureOptions.deviceId) when deciding whether to switch video input in setVideoInputDevice.
Changelog
.changes/fix-setvideoinputdevice
Added changelog entry: "Fix setVideoInputDevice not switching camera (#863)".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 I hopped through lines to find a clue,
The camera stayed — until I knew,
Now I check what's truly in sight,
Switches work, and all's alright! 📷✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix setVideoInputDevice' directly describes the main change—fixing the setVideoInputDevice camera switching bug identified in issue #863.
Linked Issues check ✅ Passed The PR successfully addresses issue #863 by changing the device comparison source from selectedVideoInputDeviceId to currentDeviceId (the pre-update device), enabling camera switching as required.
Out of Scope Changes check ✅ Passed Both changes (the logic fix in room.dart and the changelog entry) are directly scoped to fixing the setVideoInputDevice camera switching issue; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hiroshi/fix-setvideoinputdevice

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 39ac62e and d90ad33.

📒 Files selected for processing (1)
  • .changes/fix-setvideoinputdevice
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Build for Flutter Web WASM
  • GitHub Check: Build for Flutter Web
  • GitHub Check: Build for Flutter Linux
  • GitHub Check: Build for Flutter Windows
  • GitHub Check: Build for Flutter macOS
  • GitHub Check: Build for Flutter iOS
  • GitHub Check: Dart Analyze Check
  • GitHub Check: Build for Flutter Android
🔇 Additional comments (1)
.changes/fix-setvideoinputdevice (1)

1-1: LGTM!

The changelog entry accurately describes the fix, correctly references issue #863, and uses the appropriate patch level and fixed type for this bug fix.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

[bug] setVideoInputDevice does not work

3 participants