feat: add a basic_room demo (#62)
This commit is contained in:
Generated
+26
-18
@@ -199,6 +199,14 @@ version = "1.6.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
|
checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "basic_room"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"livekit",
|
||||||
|
"tokio",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bit-set"
|
name = "bit-set"
|
||||||
version = "0.5.3"
|
version = "0.5.3"
|
||||||
@@ -2521,24 +2529,6 @@ version = "0.3.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f"
|
checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "simple_room"
|
|
||||||
version = "0.1.1"
|
|
||||||
dependencies = [
|
|
||||||
"egui",
|
|
||||||
"egui-wgpu",
|
|
||||||
"egui-winit",
|
|
||||||
"futures",
|
|
||||||
"image",
|
|
||||||
"livekit",
|
|
||||||
"parking_lot",
|
|
||||||
"tokio",
|
|
||||||
"tracing",
|
|
||||||
"tracing-subscriber",
|
|
||||||
"wgpu",
|
|
||||||
"winit",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slab"
|
name = "slab"
|
||||||
version = "0.4.8"
|
version = "0.4.8"
|
||||||
@@ -3391,6 +3381,24 @@ dependencies = [
|
|||||||
"web-sys",
|
"web-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wgpu_room"
|
||||||
|
version = "0.1.1"
|
||||||
|
dependencies = [
|
||||||
|
"egui",
|
||||||
|
"egui-wgpu",
|
||||||
|
"egui-winit",
|
||||||
|
"futures",
|
||||||
|
"image",
|
||||||
|
"livekit",
|
||||||
|
"parking_lot",
|
||||||
|
"tokio",
|
||||||
|
"tracing",
|
||||||
|
"tracing-subscriber",
|
||||||
|
"wgpu",
|
||||||
|
"winit",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "which"
|
name = "which"
|
||||||
version = "4.4.0"
|
version = "4.4.0"
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
[package]
|
||||||
|
name = "basic_room"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
tokio = { version = "1", features = ["full"] }
|
||||||
|
livekit = { path = "../../livekit", version = "0.1.1" }
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
use livekit::prelude::*;
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
// Basic demo to connect to a room using the specified env variables
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let url = env::var("LIVEKIT_URL").expect("LIVEKIT_URL is not set");
|
||||||
|
let token = env::var("LIVEKIT_TOKEN").expect("LIVEKIT_TOKEN is not set");
|
||||||
|
|
||||||
|
let (room, mut rx) = Room::connect(&url, &token).await.unwrap();
|
||||||
|
let session = room.session();
|
||||||
|
println!("Connected to room: {} - {}", session.name(), session.sid());
|
||||||
|
|
||||||
|
while let Some(msg) = rx.recv().await {
|
||||||
|
println!("Event: {:?}", msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "simple_room"
|
name = "wgpu_room"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
Reference in New Issue
Block a user