diff --git a/crates/call/src/call_impl/room.rs b/crates/call/src/call_impl/room.rs index 8bb10917fe761dfcc4159d8fe56e6b2c78e213b2..4cd0be1ebd0db9d40b3e3c6dcb615528ae61e7b1 100644 --- a/crates/call/src/call_impl/room.rs +++ b/crates/call/src/call_impl/room.rs @@ -944,8 +944,8 @@ impl Room { ) })?; if self.live_kit.as_ref().map_or(true, |kit| kit.deafened) { - if matches!(track, livekit_client::RemoteTrack::Audio(_)) { - track.set_enabled(false, cx); + if publication.is_audio() { + publication.set_enabled(false, cx); } } match track { diff --git a/crates/livekit_client/src/livekit_client.rs b/crates/livekit_client/src/livekit_client.rs index 86000980e8116292efb0e00343eb6df14927115d..1bd98517d5bf6e3961dfaf92b367c1b871cbf96a 100644 --- a/crates/livekit_client/src/livekit_client.rs +++ b/crates/livekit_client/src/livekit_client.rs @@ -255,23 +255,6 @@ impl RemoteTrackPublication { } } -impl RemoteTrack { - pub fn set_enabled(&self, enabled: bool, cx: &App) { - let this = self.clone(); - Tokio::spawn(cx, async move { - match this { - RemoteTrack::Audio(remote_audio_track) => { - remote_audio_track.0.rtc_track().set_enabled(enabled) - } - RemoteTrack::Video(remote_video_track) => { - remote_video_track.0.rtc_track().set_enabled(enabled) - } - } - }) - .detach(); - } -} - impl Participant { pub fn identity(&self) -> ParticipantIdentity { match self { diff --git a/crates/livekit_client/src/mock_client/publication.rs b/crates/livekit_client/src/mock_client/publication.rs index 70ef3b7c2613235abcabe933ef239a7703eb20df..8c6494e03a03cba9d8fbe906798fbcc045e4b59f 100644 --- a/crates/livekit_client/src/mock_client/publication.rs +++ b/crates/livekit_client/src/mock_client/publication.rs @@ -89,12 +89,3 @@ impl RemoteTrackPublication { } } } - -impl RemoteTrack { - pub fn set_enabled(&self, enabled: bool, _cx: &App) { - match self { - RemoteTrack::Audio(remote_audio_track) => remote_audio_track.set_enabled(enabled), - RemoteTrack::Video(remote_video_track) => remote_video_track.set_enabled(enabled), - } - } -} diff --git a/crates/livekit_client/src/mock_client/track.rs b/crates/livekit_client/src/mock_client/track.rs index 61909370aac94cd1930c8db4a57d46d1be1c81e0..e1565e8d71ed9d813efa254b2cdc8cf680356276 100644 --- a/crates/livekit_client/src/mock_client/track.rs +++ b/crates/livekit_client/src/mock_client/track.rs @@ -43,23 +43,6 @@ impl RemoteAudioTrack { false } } - - pub fn set_enabled(&self, enabled: bool) { - let Some(room) = self.room.upgrade() else { - return; - }; - if enabled { - room.0 - .lock() - .paused_audio_tracks - .remove(&self.server_track.sid); - } else { - room.0 - .lock() - .paused_audio_tracks - .insert(self.server_track.sid.clone()); - } - } } impl RemoteVideoTrack { @@ -70,6 +53,4 @@ impl RemoteVideoTrack { pub fn publisher_id(&self) -> ParticipantIdentity { self.server_track.publisher_id.clone() } - - pub(crate) fn set_enabled(&self, _enabled: bool) {} }