Skip to content

Conversation

@hiroshihorie
Copy link
Member

@hiroshihorie hiroshihorie commented Jan 30, 2026

  • 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 camera device detection logic to correctly identify the active video input device when switching cameras.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

The setVideoInputDevice method in the room hardware management was updated to compare against the room's active camera device ID instead of the selected video input device ID when determining whether a device switch is necessary.

Changes

Cohort / File(s) Summary
Device Comparison Logic
lib/src/core/room.dart
Updated setVideoInputDevice to use currentDeviceId from engine.roomOptions.defaultCameraCaptureOptions.deviceId instead of selectedVideoInputDeviceId for the device change comparison check.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A camera's heart now beats more true,
We check the real device in view—
Not what was picked, but what's in use,
A simpler path, a cleaner ruse! 📹✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 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 refers to the specific method being fixed and aligns with the main change: correcting the device comparison logic in the setVideoInputDevice method.
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 2e421d4 and 39ac62e.

📒 Files selected for processing (1)
  • lib/src/core/room.dart
⏰ 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). (7)
  • GitHub Check: Build for Flutter Linux
  • GitHub Check: Build for Flutter macOS
  • GitHub Check: Build for Flutter Web WASM
  • GitHub Check: Build for Flutter iOS
  • GitHub Check: Build for Flutter Web
  • GitHub Check: Build for Flutter Windows
  • GitHub Check: Build for Flutter Android
🔇 Additional comments (1)
lib/src/core/room.dart (1)

1122-1136: LGTM — pre-update device comparison fixes switch decision.

The updated currentDeviceId comparison avoids skipping switchCamera after updating room options.

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


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.

2 participants