rustrtc 0.3.48

A high-performance implementation of WebRTC
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use rustrtc::{MediaKind, PeerConnection, RtcConfiguration, TransceiverDirection, TransportMode};

#[tokio::main]
async fn main() {
    let mut config = RtcConfiguration::default();
    config.transport_mode = TransportMode::WebRtc;

    let pc = PeerConnection::new(config);
    pc.add_transceiver(MediaKind::Audio, TransceiverDirection::SendRecv);
    pc.create_data_channel("test", None).unwrap();

    let offer = pc.create_offer().await.unwrap();
    println!("SDP:\n{}", offer.to_sdp_string());
}