Rename livekit_server
to livekit_api
(#24984)
The name `livekit_server` was a bit misleading as it is not a server and gets built into both the client and server - the server code is in `collab`. Release Notes: - N/A
This commit is contained in:
parent
2400fb4d9e
commit
c7df2d787b
29 changed files with 61 additions and 62 deletions
|
@ -28,7 +28,7 @@ cpal = "0.15"
|
|||
futures.workspace = true
|
||||
gpui.workspace = true
|
||||
http_2 = { package = "http", version = "0.2.1" }
|
||||
livekit_server.workspace = true
|
||||
livekit_api.workspace = true
|
||||
log.workspace = true
|
||||
media.workspace = true
|
||||
nanoid = { workspace = true, optional = true }
|
||||
|
|
|
@ -33,7 +33,7 @@ use livekit_client::{
|
|||
AudioStream, RemoteVideoTrackView, Room, RoomEvent,
|
||||
};
|
||||
|
||||
use livekit_server::token::{self, VideoGrant};
|
||||
use livekit_api::token::{self, VideoGrant};
|
||||
use log::LevelFilter;
|
||||
use simplelog::SimpleLogger;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ use collections::{btree_map::Entry as BTreeEntry, hash_map::Entry, BTreeMap, Has
|
|||
use gpui::BackgroundExecutor;
|
||||
#[cfg(not(all(target_os = "windows", target_env = "gnu")))]
|
||||
use livekit::options::TrackPublishOptions;
|
||||
use livekit_server::{proto, token};
|
||||
use livekit_api::{proto, token};
|
||||
use parking_lot::Mutex;
|
||||
use postage::{mpsc, sink::Sink};
|
||||
use std::sync::{
|
||||
|
@ -107,7 +107,7 @@ impl TestServer {
|
|||
async fn join_room(&self, token: String, client_room: Room) -> Result<ParticipantIdentity> {
|
||||
self.executor.simulate_random_delay().await;
|
||||
|
||||
let claims = livekit_server::token::validate(&token, &self.secret_key)?;
|
||||
let claims = livekit_api::token::validate(&token, &self.secret_key)?;
|
||||
let identity = ParticipantIdentity(claims.sub.unwrap().to_string());
|
||||
let room_name = claims.video.room.unwrap();
|
||||
let mut server_rooms = self.rooms.lock();
|
||||
|
@ -174,7 +174,7 @@ impl TestServer {
|
|||
async fn leave_room(&self, token: String) -> Result<()> {
|
||||
self.executor.simulate_random_delay().await;
|
||||
|
||||
let claims = livekit_server::token::validate(&token, &self.secret_key)?;
|
||||
let claims = livekit_api::token::validate(&token, &self.secret_key)?;
|
||||
let identity = ParticipantIdentity(claims.sub.unwrap().to_string());
|
||||
let room_name = claims.video.room.unwrap();
|
||||
let mut server_rooms = self.rooms.lock();
|
||||
|
@ -195,7 +195,7 @@ impl TestServer {
|
|||
&self,
|
||||
token: String,
|
||||
) -> Result<HashMap<ParticipantIdentity, RemoteParticipant>> {
|
||||
let claims = livekit_server::token::validate(&token, &self.secret_key)?;
|
||||
let claims = livekit_api::token::validate(&token, &self.secret_key)?;
|
||||
let local_identity = ParticipantIdentity(claims.sub.unwrap().to_string());
|
||||
let room_name = claims.video.room.unwrap().to_string();
|
||||
|
||||
|
@ -288,7 +288,7 @@ impl TestServer {
|
|||
) -> Result<TrackSid> {
|
||||
self.executor.simulate_random_delay().await;
|
||||
|
||||
let claims = livekit_server::token::validate(&token, &self.secret_key)?;
|
||||
let claims = livekit_api::token::validate(&token, &self.secret_key)?;
|
||||
let identity = ParticipantIdentity(claims.sub.unwrap().to_string());
|
||||
let room_name = claims.video.room.unwrap();
|
||||
|
||||
|
@ -354,7 +354,7 @@ impl TestServer {
|
|||
) -> Result<TrackSid> {
|
||||
self.executor.simulate_random_delay().await;
|
||||
|
||||
let claims = livekit_server::token::validate(&token, &self.secret_key)?;
|
||||
let claims = livekit_api::token::validate(&token, &self.secret_key)?;
|
||||
let identity = ParticipantIdentity(claims.sub.unwrap().to_string());
|
||||
let room_name = claims.video.room.unwrap();
|
||||
|
||||
|
@ -419,7 +419,7 @@ impl TestServer {
|
|||
}
|
||||
|
||||
fn set_track_muted(&self, token: &str, track_sid: &TrackSid, muted: bool) -> Result<()> {
|
||||
let claims = livekit_server::token::validate(&token, &self.secret_key)?;
|
||||
let claims = livekit_api::token::validate(&token, &self.secret_key)?;
|
||||
let room_name = claims.video.room.unwrap();
|
||||
let identity = ParticipantIdentity(claims.sub.unwrap().to_string());
|
||||
let mut server_rooms = self.rooms.lock();
|
||||
|
@ -473,7 +473,7 @@ impl TestServer {
|
|||
}
|
||||
|
||||
fn is_track_muted(&self, token: &str, track_sid: &TrackSid) -> Option<bool> {
|
||||
let claims = livekit_server::token::validate(&token, &self.secret_key).ok()?;
|
||||
let claims = livekit_api::token::validate(&token, &self.secret_key).ok()?;
|
||||
let room_name = claims.video.room.unwrap();
|
||||
|
||||
let mut server_rooms = self.rooms.lock();
|
||||
|
@ -488,7 +488,7 @@ impl TestServer {
|
|||
}
|
||||
|
||||
fn video_tracks(&self, token: String) -> Result<Vec<RemoteVideoTrack>> {
|
||||
let claims = livekit_server::token::validate(&token, &self.secret_key)?;
|
||||
let claims = livekit_api::token::validate(&token, &self.secret_key)?;
|
||||
let room_name = claims.video.room.unwrap();
|
||||
let identity = ParticipantIdentity(claims.sub.unwrap().to_string());
|
||||
|
||||
|
@ -511,7 +511,7 @@ impl TestServer {
|
|||
}
|
||||
|
||||
fn audio_tracks(&self, token: String) -> Result<Vec<RemoteAudioTrack>> {
|
||||
let claims = livekit_server::token::validate(&token, &self.secret_key)?;
|
||||
let claims = livekit_api::token::validate(&token, &self.secret_key)?;
|
||||
let room_name = claims.video.room.unwrap();
|
||||
let identity = ParticipantIdentity(claims.sub.unwrap().to_string());
|
||||
|
||||
|
@ -641,7 +641,7 @@ pub enum RoomEvent {
|
|||
|
||||
#[cfg(not(all(target_os = "windows", target_env = "gnu")))]
|
||||
#[async_trait]
|
||||
impl livekit_server::api::Client for TestApiClient {
|
||||
impl livekit_api::Client for TestApiClient {
|
||||
fn url(&self) -> &str {
|
||||
&self.url
|
||||
}
|
||||
|
@ -670,7 +670,7 @@ impl livekit_server::api::Client for TestApiClient {
|
|||
&self,
|
||||
room: String,
|
||||
identity: String,
|
||||
permission: livekit_server::proto::ParticipantPermission,
|
||||
permission: livekit_api::proto::ParticipantPermission,
|
||||
) -> Result<()> {
|
||||
let server = TestServer::get(&self.url)?;
|
||||
server
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue