Skip to content

Commit c7d9fac

Browse files
fix: set proper mute state for audio/video tracks after reconnection (#963)
Closes #962 ### How does it fix that? The methods `publishAudioTrack` and `publishVideoTrack` are called on call reconnection here - https://github.com/livekit/client-sdk-flutter/blob/70d4d1f5fdc6f565cbe565e3d5a50d5c23b5ddef/lib/src/participant/local.dart#L560-L570 But inside the methods we're not passing the `muted` state from the old tracks we have. It defaults to `false` because it's not set in protobuf: https://github.com/livekit/client-sdk-flutter/blob/70d4d1f5fdc6f565cbe565e3d5a50d5c23b5ddef/lib/src/proto/livekit_rtc.pb.dart#L1153 By passing it correctly, this PR fixes the bug in the linked issue. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed an issue where the muted state of audio and video tracks was not being correctly propagated when publishing to the server. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 70d4d1f commit c7d9fac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/src/participant/local.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ class LocalParticipant extends Participant<LocalTrackPublication> {
134134
name: publishOptions.name ?? AudioPublishOptions.defaultMicrophoneName,
135135
type: track.kind.toPBType(),
136136
source: track.source.toPBType(),
137+
muted: track.muted,
137138
stream: buildStreamId(publishOptions, track.source),
138139
disableDtx: !publishOptions.dtx,
139140
disableRed: room.e2eeManager != null ? true : publishOptions.red ?? true,
@@ -361,7 +362,7 @@ class LocalParticipant extends Participant<LocalTrackPublication> {
361362
source: track.source.toPBType(),
362363
encryption: room.roomOptions.lkEncryptionType,
363364
simulcastCodecs: simulcastCodecs,
364-
muted: false,
365+
muted: track.muted,
365366
stream: buildStreamId(publishOptions, track.source),
366367
);
367368

0 commit comments

Comments
 (0)