Files
oak-gpui/crates/livekit_client/src/mock_client/track.rs
T
Conrad Irwin ee7b1ec7f2 Fix deafening new participants (#28330)
Release Notes:

- Fixed an issue where new participants were not muted when the room was
deafened
2025-04-08 16:01:27 +00:00

57 lines
1.2 KiB
Rust

use std::sync::Arc;
use crate::{
ParticipantIdentity, TrackSid,
test::{TestServerAudioTrack, TestServerVideoTrack, WeakRoom},
};
#[derive(Clone, Debug)]
pub struct LocalVideoTrack {}
#[derive(Clone, Debug)]
pub struct LocalAudioTrack {}
#[derive(Clone, Debug)]
pub struct RemoteVideoTrack {
pub(crate) server_track: Arc<TestServerVideoTrack>,
pub(crate) _room: WeakRoom,
}
#[derive(Clone, Debug)]
pub struct RemoteAudioTrack {
pub(crate) server_track: Arc<TestServerAudioTrack>,
pub(crate) room: WeakRoom,
}
impl RemoteAudioTrack {
pub fn sid(&self) -> TrackSid {
self.server_track.sid.clone()
}
pub fn publisher_id(&self) -> ParticipantIdentity {
self.server_track.publisher_id.clone()
}
pub fn enabled(&self) -> bool {
if let Some(room) = self.room.upgrade() {
!room
.0
.lock()
.paused_audio_tracks
.contains(&self.server_track.sid)
} else {
false
}
}
}
impl RemoteVideoTrack {
pub fn sid(&self) -> TrackSid {
self.server_track.sid.clone()
}
pub fn publisher_id(&self) -> ParticipantIdentity {
self.server_track.publisher_id.clone()
}
}