Files
amethyst/amethyst
Claude 31a3c06544 fix: complete overhaul of video toggle state and camera lifecycle
Four bugs fixed:

1. _isVideoEnabled defaulted to true — voice calls showed the
   camera icon as "active" even though no video was being sent.
   Changed default to false; only set true when video track is
   actually created (video call initiation or acceptance).

2. cleanup() reset _isVideoEnabled to true — next call started
   with wrong state. Changed to false.

3. stopCamera() disposed the capturer but toggleVideo re-enable
   path only called setVideoEnabled(true) without restarting the
   camera. No frames were captured. Now re-enable path calls
   startCamera() to create a fresh capturer.

4. startCamera() made public on WebRtcCallSession with guard
   against double-start (returns early if cameraCapturer != null).

State flow is now:
- Voice call: _isVideoEnabled=false, icon shows "camera off"
- Tap camera: creates track + starts camera, _isVideoEnabled=true
- Tap camera again: stops camera + disables track, =false
- Tap camera again: restarts camera + enables track, =true
- Video call: _isVideoEnabled=true from start, camera running

https://claude.ai/code/session_017hZm7yu7CzmcQgZGSaqSXS
2026-04-02 14:41:50 +00:00
..