Skip to content

Commit

Permalink
set immediately to muted
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzhao committed Dec 4, 2024
1 parent c49f97a commit 87a8d29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/room_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 2 additions & 0 deletions livekit-rtc/livekit/rtc/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})"
Expand Down

0 comments on commit 87a8d29

Please sign in to comment.