Skip to content

Commit acca107

Browse files
committed
fix: hide local camera preview when video is logically muted
1 parent 41a862a commit acca107

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

lib/features/call/bloc/call_state.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,12 @@ class ActiveCall with _$ActiveCall implements CallEntry {
231231

232232
bool get remoteVideo => remoteStream?.getVideoTracks().isNotEmpty ?? video;
233233

234-
bool get localVideo => localStream?.getVideoTracks().isNotEmpty ?? false;
235-
236-
bool get cameraEnabled => localStream?.getVideoTracks().firstOrNull?.enabled == true;
234+
/// Determines whether the local camera preview should be shown.
235+
///
236+
/// The `&& video` check prevents displaying a "black square" when the video is
237+
/// logically muted (user intent), but the track remains technically active
238+
/// (e.g., sending black frames to maintain the co
239+
bool get cameraEnabled => localStream?.getVideoTracks().firstOrNull?.enabled == true && video;
237240
}
238241

239242
extension ActiveCallIterableExtension<T extends ActiveCall> on Iterable<T> {

lib/features/call/view/call_active_scaffold.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class CallActiveScaffoldState extends State<CallActiveScaffold> {
7979
),
8080
),
8181
),
82-
if (activeCall.localVideo)
82+
if (activeCall.cameraEnabled)
8383
AnimatedPositioned(
8484
right: 10 + mediaQueryData.padding.right,
8585
top: 10 + mediaQueryData.padding.top + (compact ? 0 : 100),

0 commit comments

Comments
 (0)