From 6475a85ef25effae2b44683caa0257386da0dee0 Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Mon, 19 Aug 2024 19:34:07 -0700 Subject: [PATCH] added webrtc sdp packet type --- Cargo.toml | 1 + src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a0a3f51..7fdbb61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,3 +13,4 @@ serde_json = "1.0.125" tokio = { version = "1.39.2", features = ["net", "rt", "sync"] } tokio-tungstenite = "0.23.1" tracing = "0.1.40" +webrtc = "0.11.0" diff --git a/src/lib.rs b/src/lib.rs index cd99056..a72c20a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,12 +14,13 @@ use tokio_tungstenite::{connect_async, tungstenite::Message, MaybeTlsStream, Web use tokio_tungstenite::tungstenite::error::Error as tungstenite_error; use tracing::field::debug; use tracing::{error, info, instrument}; +use webrtc::peer_connection::sdp::session_description::RTCSessionDescription; static MAX_MESSAGE: usize = 50; #[derive(Serialize, Deserialize)] pub enum ApplicationMessage { - WebRTCPacket(String), + WebRTCPacket(RTCSessionDescription), } @@ -182,7 +183,6 @@ async fn listen_to_ws( } is_closed.store(true, std::sync::atomic::Ordering::SeqCst); - }