Update examples/webrtc.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
lichon
2025-11-17 14:45:51 +08:00
committed by GitHub
parent 3282977e66
commit 13ef3411d9

View File

@@ -17,16 +17,19 @@ use tokio::time::Duration;
#[cfg(feature = "webrtc")]
use webrtc::peer_connection::math_rand_alpha;
#[cfg(not(feature = "webrtc"))]
#[tokio::main]
async fn main() -> Result<()> {
println!(
"The webrtc feature is not enabled. \
Please enable the webrtc feature to run this example."
);
Ok(())
}
#[cfg(feature = "webrtc")]
#[tokio::main]
async fn main() -> Result<()> {
#[cfg(not(feature = "webrtc"))]
if true {
println!(
"The webrtc feature is not enabled. \
Please enable the webrtc feature to run this example."
);
return Ok(());
}
let app = Command::new("webrtc-stream")
.about("An example of webrtc stream using hbb_common and webrtc-rs")
.arg(