mirror of
https://github.com/pion/webrtc.git
synced 2025-09-27 03:25:58 +08:00
Rename sfu -> sfu-minimal
We have a websocket SFU example now also Resolves #507
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -18,3 +18,5 @@ tags
|
|||||||
cover.out
|
cover.out
|
||||||
*.sw[poe]
|
*.sw[poe]
|
||||||
*.wasm
|
*.wasm
|
||||||
|
examples/sfu-ws/cert.pem
|
||||||
|
examples/sfu-ws/key.pem
|
||||||
|
@@ -11,7 +11,8 @@ We've build an extensive collection of examples covering common use-cases. You c
|
|||||||
* [Gstreamer Send Offer](gstreamer-send-offer): Example gstreamer-send-offer is a variant of gstreamer-send that initiates the WebRTC connection by sending an offer.
|
* [Gstreamer Send Offer](gstreamer-send-offer): Example gstreamer-send-offer is a variant of gstreamer-send that initiates the WebRTC connection by sending an offer.
|
||||||
* [Save to Disk](save-to-disk): The save-to-disk example shows how to record your webcam and save the footage to disk on the server side.
|
* [Save to Disk](save-to-disk): The save-to-disk example shows how to record your webcam and save the footage to disk on the server side.
|
||||||
* [Janus Gateway](janus-gateway): Example janus-gateway is a collection of examples showing how to use Pion WebRTC with [janus-gateway](https://github.com/meetecho/janus-gateway).
|
* [Janus Gateway](janus-gateway): Example janus-gateway is a collection of examples showing how to use Pion WebRTC with [janus-gateway](https://github.com/meetecho/janus-gateway).
|
||||||
* [SFU](sfu): The SFU example demonstrates how to broadcast a video to multiple peers. A broadcaster uploads the video once and the server forwards it to all other peers.
|
* [SFU Minimal](sfu-minimal): The SFU example demonstrates how to broadcast a video to multiple peers. A broadcaster uploads the video once and the server forwards it to all other peers.
|
||||||
|
* [SFU Websocket](sfu-websocket): The SFU example demonstrates how to broadcast a video to multiple peers. A broadcaster uploads the video once and the server forwards it to all other peers.
|
||||||
|
|
||||||
#### Data Channel API
|
#### Data Channel API
|
||||||
* [Data Channels](data-channels): The data-channels example shows how you can send/recv DataChannel messages from a web browser.
|
* [Data Channels](data-channels): The data-channels example shows how you can send/recv DataChannel messages from a web browser.
|
||||||
@@ -26,7 +27,7 @@ We've build an extensive collection of examples covering common use-cases. You c
|
|||||||
|
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
We've made it easy to run the browser based examples on your local machine.
|
We've made it easy to run the browser based examples on your local machine.
|
||||||
|
|
||||||
1. Build and run the example server:
|
1. Build and run the example server:
|
||||||
``` sh
|
``` sh
|
||||||
@@ -34,7 +35,7 @@ We've made it easy to run the browser based examples on your local machine.
|
|||||||
cd $GOPATH/src/github.com/pions/webrtc/examples
|
cd $GOPATH/src/github.com/pions/webrtc/examples
|
||||||
go run examples.go
|
go run examples.go
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Browse to [localhost](http://localhost) to browse through the examples.
|
2. Browse to [localhost](http://localhost) to browse through the examples.
|
||||||
|
|
||||||
Note that you can change the port of the server using the ``--address`` flag.
|
Note that you can change the port of the server using the ``--address`` flag.
|
||||||
@@ -48,4 +49,4 @@ Some of our examples have support for WebAssembly. The same examples server docu
|
|||||||
GOOS=js GOARCH=wasm go build -o demo.wasm
|
GOOS=js GOARCH=wasm go build -o demo.wasm
|
||||||
```
|
```
|
||||||
3. Start the example server. Refer to the [usage](#usage) section for how you can build the example server.
|
3. Start the example server. Refer to the [usage](#usage) section for how you can build the example server.
|
||||||
4. Browse to [localhost](http://localhost). The page should now give you the option to run the example using the WebAssembly binary.
|
4. Browse to [localhost](http://localhost). The page should now give you the option to run the example using the WebAssembly binary.
|
||||||
|
32
examples/sfu-minimal/README.md
Normal file
32
examples/sfu-minimal/README.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# sfu-minimal
|
||||||
|
sfu-minimal is a pion-WebRTC application that demonstrates how to broadcast a video to many peers, while only requiring the broadcaster to upload once.
|
||||||
|
|
||||||
|
This could serve as the building block to building conferencing software, and other applications where publishers are bandwidth constrained.
|
||||||
|
|
||||||
|
## Instructions
|
||||||
|
### Download sfu-minimal
|
||||||
|
```
|
||||||
|
go get github.com/pions/webrtc/examples/sfu-minimal
|
||||||
|
```
|
||||||
|
|
||||||
|
### Open sfu-minimal example page
|
||||||
|
[jsfiddle.net](https://jsfiddle.net/5cwx0rns/11/) You should see two buttons 'Publish a Broadcast' and 'Join a Broadcast'
|
||||||
|
|
||||||
|
### Run SFU Minimal
|
||||||
|
#### Linux/macOS
|
||||||
|
Run `sfu-minimal` OR run `main.go` in `github.com/pions/webrtc/examples/sfu-minimal`
|
||||||
|
|
||||||
|
### Start a publisher
|
||||||
|
|
||||||
|
* Click `Publish a Broadcast`
|
||||||
|
* `curl localhost:8080/sdp -d "YOUR SDP"`. The `sfu-minimal` application will respond with an offer, paste this into the second input field. Then press `Start Session`
|
||||||
|
|
||||||
|
### Join the broadcast
|
||||||
|
* Click `Join a Broadcast`
|
||||||
|
* `curl localhost:8080/sdp -d "YOUR SDP"`. The `sfu-minimal` application will respond with an offer, paste this into the second input field. Then press `Start Session`
|
||||||
|
|
||||||
|
You can change the listening port using `-port 8011`
|
||||||
|
|
||||||
|
You can `Join the broadcast` as many times as you want. The `sfu-minimal` Golang application is relaying all traffic, so your browser only has to upload once.
|
||||||
|
|
||||||
|
Congrats, you have used pion-WebRTC! Now start building something cool
|
@@ -1,32 +0,0 @@
|
|||||||
# sfu
|
|
||||||
sfu is a pion-WebRTC application that demonstrates how to broadcast a video to many peers, while only requiring the broadcaster to upload once.
|
|
||||||
|
|
||||||
This could serve as the building block to building conferencing software, and other applications where publishers are bandwidth constrained.
|
|
||||||
|
|
||||||
## Instructions
|
|
||||||
### Download sfu
|
|
||||||
```
|
|
||||||
go get github.com/pions/webrtc/examples/sfu
|
|
||||||
```
|
|
||||||
|
|
||||||
### Open sfu example page
|
|
||||||
[jsfiddle.net](https://jsfiddle.net/5cwx0rns/11/) You should see two buttons 'Publish a Broadcast' and 'Join a Broadcast'
|
|
||||||
|
|
||||||
### Run SFU
|
|
||||||
#### Linux/macOS
|
|
||||||
Run `sfu` OR run `main.go` in `github.com/pions/webrtc/examples/sfu`
|
|
||||||
|
|
||||||
### Start a publisher
|
|
||||||
|
|
||||||
* Click `Publish a Broadcast`
|
|
||||||
* `curl localhost:8080/sdp -d "YOUR SDP"`. The `sfu` application will respond with an offer, paste this into the second input field. Then press `Start Session`
|
|
||||||
|
|
||||||
### Join the broadcast
|
|
||||||
* Click `Join a Broadcast`
|
|
||||||
* `curl localhost:8080/sdp -d "YOUR SDP"`. The `sfu` application will respond with an offer, paste this into the second input field. Then press `Start Session`
|
|
||||||
|
|
||||||
You can change the listening port using `-port 8011`
|
|
||||||
|
|
||||||
You can `Join the broadcast` as many times as you want. The `sfu` Golang application is relaying all traffic, so your browser only has to upload once.
|
|
||||||
|
|
||||||
Congrats, you have used pion-WebRTC! Now start building something cool
|
|
Reference in New Issue
Block a user