From 87a8d296bd1500d7d2fe1de5488210b15954a698 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Wed, 4 Dec 2024 00:31:51 -0800 Subject: [PATCH] set immediately to muted --- examples/room_example.py | 6 ++++-- livekit-rtc/livekit/rtc/track.py | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/room_example.py b/examples/room_example.py index 67db8444..f71ca963 100644 --- a/examples/room_example.py +++ b/examples/room_example.py @@ -49,8 +49,10 @@ def on_track_subscribed( print(f"participant identity: {participant.identity}") print(f"participant name: {participant.name}") print(f"participant kind: {participant.kind}") - print(f"participant track publications: { - participant.track_publications}") + print( + f"participant track publications: { + participant.track_publications}" + ) for tid, publication in participant.track_publications.items(): print(f"\ttrack id: {tid}") print(f"\t\ttrack publication: {publication}") diff --git a/livekit-rtc/livekit/rtc/track.py b/livekit-rtc/livekit/rtc/track.py index 6231da9e..6c24607c 100644 --- a/livekit-rtc/livekit/rtc/track.py +++ b/livekit-rtc/livekit/rtc/track.py @@ -114,12 +114,14 @@ def mute(self): req.local_track_mute.track_handle = self._ffi_handle.handle req.local_track_mute.mute = True FfiClient.instance.request(req) + self._info.muted = True def unmute(self): req = proto_ffi.FfiRequest() req.local_track_mute.track_handle = self._ffi_handle.handle req.local_track_mute.mute = False FfiClient.instance.request(req) + self._info.muted = False def __repr__(self) -> str: return f"rtc.LocalVideoTrack(sid={self.sid}, name={self.name})"