Skip to content

Commit a9ad4b0

Browse files
committed
add broadcast.rs example
1 parent 5e2beec commit a9ad4b0

File tree

6 files changed

+489
-264
lines changed

6 files changed

+489
-264
lines changed

Cargo.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ description = "A pure Rust implementation of WebRTC API"
1414
[features]
1515
default = ["runtime-tokio"]
1616
runtime-tokio = ["dep:tokio"]
17-
runtime-smol = ["dep:smol"]
17+
runtime-smol = ["dep:smol", "dep:async-broadcast"]
1818

1919
[dependencies]
2020
rtc = { version = "0.9.0", path = "rtc/rtc" }
@@ -26,6 +26,7 @@ futures = "0.3.31"
2626
# Async runtimes (all optional)
2727
tokio = { version = "1.49.0", features = ["net", "time", "sync", "rt", "rt-multi-thread"], optional = true }
2828
smol = { version = "2.0.2", optional = true }
29+
async-broadcast = { version = "0.7", optional = true }
2930

3031
[dev-dependencies]
3132
env_logger = "0.11.8"
@@ -38,10 +39,10 @@ signal = { version = "0.9.0", path = "rtc/examples/examples/signal", package = "
3839
hyper = { version = "0.14.32", features = ["full"] }
3940
rand = "0.10.0"
4041

41-
#[[example]]
42-
#name = "broadcast"
43-
#path = "examples/broadcast/broadcast.rs"
44-
#bench = false
42+
[[example]]
43+
name = "broadcast"
44+
path = "examples/broadcast/broadcast.rs"
45+
bench = false
4546

4647
[[example]]
4748
name = "data-channels"

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ check [Pion Examples](https://github.com/pion/webrtc/tree/master/examples#readme
4242
using RTP.
4343
-[RTP to WebRTC](rtp-to-webrtc): The rtp-to-webrtc example demonstrates how to take RTP packets sent to a webrtc-rs
4444
process into your browser.
45-
- 🚧 [Broadcast](broadcast): The broadcast example demonstrates how to broadcast a video to multiple peers. A
45+
- [Broadcast](broadcast): The broadcast example demonstrates how to broadcast a video to multiple peers. A
4646
broadcaster uploads the video once and the server forwards it to all other peers.
4747
- 🚧 [Simulcast](simulcast): The simulcast example demonstrates how to accept and demux 1 Track that contains 3
4848
Simulcast streams. It then returns the media as 3 independent Tracks back to the sender.

0 commit comments

Comments
 (0)