Skip to content

Commit a0adcb6

Browse files
authored
Fix setVideoInputDevice (#973)
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. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 217f772 commit a0adcb6

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

.changes/fix-setvideoinputdevice

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
patch type="fixed" "Fix setVideoInputDevice not switching camera"

lib/src/core/room.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ extension RoomHardwareManagementMethods on Room {
11301130
);
11311131

11321132
try {
1133-
if (track != null && selectedVideoInputDeviceId != device.deviceId) {
1133+
if (track != null && currentDeviceId != device.deviceId) {
11341134
await track.switchCamera(device.deviceId);
11351135
Hardware.instance.selectedVideoInput = device;
11361136
}

0 commit comments

Comments
 (0)