Skip to content

Commit

Permalink
Add missing newlines in 'README.md' files
Browse files Browse the repository at this point in the history
  • Loading branch information
regexident committed Jan 9, 2023
1 parent 7690dbd commit 0186b0a
Show file tree
Hide file tree
Showing 22 changed files with 175 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,5 @@ Dual licensing under both MIT and Apache-2.0 is the currently accepted standard


## Contributing

Contributors or Pull Requests are Welcome!!!
1 change: 1 addition & 0 deletions dtls/examples/certificates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ $ rm "${EXTFILE}" "${SERVER_NAME}.csr" "${CLIENT_NAME}.csr"
```

in pion/examples/util/util.go, convert ECPrivateKey to PKCS8PrivateKey

```go
func LoadKey(path string) (crypto.PrivateKey, error) {
....
Expand Down
7 changes: 7 additions & 0 deletions examples/examples/broadcast/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
# broadcast

broadcast is a WebRTC.rs 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

### Build broadcast

```shell
cargo build --example broadcast
```

### Open broadcast example page

[jsfiddle.net](https://jsfiddle.net/1jc4go7v/) You should see two buttons 'Publish a Broadcast' and 'Join a Broadcast'

### Run Broadcast

#### Linux/macOS

Run `broadcast`

### Start a publisher
Expand All @@ -26,6 +32,7 @@ Run `broadcast`
* The connection state will be printed in the terminal and under `logs` in the browser.

### Join the broadcast

* Click `Join a Broadcast`
* Copy the string in the first input labelled `Browser base64 Session Description`
* Run `curl localhost:8080/sdp -d "$BROWSER_OFFER"`. `$BROWSER_OFFER` is the value you copied in the last step.
Expand Down
8 changes: 8 additions & 0 deletions examples/examples/data-channels-create/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
# data-channels-create

data-channels-create is a WebRTC.rs application that shows how you can send/recv DataChannel messages from a web browser. The difference with the data-channels example is that the datachannel is initialized from the WebRTC.rs side in this example.

## Instructions

### Build data-channels-create

```shell
cargo build --example data-channels-create
```

### Open data-channels-create example page

[jsfiddle.net](https://jsfiddle.net/swgxrp94/20/)

### Run data-channels-create

Just run `data-channels-create`.

### Input data-channels-create's SessionDescription into your browser

Copy the text that `data-channels-create` just emitted and copy into first text area of the jsfiddle.

### Hit 'Start Session' in jsfiddle

Hit the 'Start Session' button in the browser. You should see `have-remote-offer` below the `Send Message` button.

### Input browser's SessionDescription into data-channels-create

Meanwhile text has appeared in the second text area of the jsfiddle. Copy the text and paste it into `data-channels-create` and hit ENTER.
In the browser you'll now see `connected` as the connection is created. If everything worked you should see `New DataChannel data`.

Expand Down
2 changes: 2 additions & 0 deletions examples/examples/data-channels-detach-create/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ This allows direct access the the underlying [webrtc-rs/data](https://github.com
The example mirrors the data-channels-create example.

## Install

```shell
cargo build --example data-channels-detach-create
```

## Usage

The example can be used in the same way as the [Data Channels Create](data-channels-create) example.
11 changes: 11 additions & 0 deletions examples/examples/data-channels-detach/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
# data-channels

data-channels is a WebRTC.rs application that shows how you can send/recv DataChannel messages from a web browser

## Instructions

### Build data-channels-detach

```shell
cargo build --example data-channels-detach
```

### Open data-channels-detach example page

[jsfiddle.net](https://jsfiddle.net/9tsx15mg/90/)

### Run data-channels-detach, with your browsers SessionDescription as stdin

In the jsfiddle the top textarea is your browser's session description, copy that and:

#### Linux/macOS

Run `echo $BROWSER_SDP | ./target/debug/examples/data-channels-detach`

#### Windows

1. Paste the SessionDescription into a file.
1. Run `./target/debug/examples/data-channels-detach < my_file`

### Input data-channels-detach's SessionDescription into your browser

Copy the text that `data-channels` just emitted and copy into second text area

### Hit 'Start Session' in jsfiddle

Under Start Session you should see 'Checking' as it starts connecting. If everything worked you should see `New DataChannel foo 1`

Now you can put whatever you want in the `Message` textarea, and when you hit `Send Message` it should appear in your terminal!
Expand Down
3 changes: 3 additions & 0 deletions examples/examples/data-channels-flow-control/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# data-channels-flow-control

This example demonstrates how to use the following property / methods.

* pub async fn buffered_amount(&self) -> usize
Expand All @@ -10,6 +11,7 @@ These methods are equivalent to that of JavaScript WebRTC API.
See https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel for more details.

## When do we need it?

Send or SendText methods are called on DataChannel to send data to the connected peer.
The methods return immediately, but it does not mean the data was actually sent onto
the wire. Instead, it is queued in a buffer until it actually gets sent out to the wire.
Expand All @@ -23,6 +25,7 @@ actually send to the peer over the Internet. The above properties/methods help y
application to pace the amount of data to be pushed into the data channel.

## How to run the example code

The demo code implements two endpoints (requester and responder) in it.

```plain
Expand Down
11 changes: 11 additions & 0 deletions examples/examples/data-channels/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
# data-channels

data-channels is a WebRTC.rs application that shows how you can send/recv DataChannel messages from a web browser

## Instructions

### Build data-channels

```shell
cargo build --example data-channels
```

### Open data-channels example page

[jsfiddle.net](https://jsfiddle.net/9tsx15mg/90/)

### Run data-channels, with your browsers SessionDescription as stdin

In the jsfiddle the top textarea is your browser's session description, copy that and:

#### Linux/macOS

Run `echo $BROWSER_SDP | ./target/debug/examples/data-channels`

#### Windows

1. Paste the SessionDescription into a file.
1. Run `./target/debug/examples/data-channels < my_file`

### Input data-channels's SessionDescription into your browser

Copy the text that `data-channels` just emitted and copy into second text area

### Hit 'Start Session' in jsfiddle

Under Start Session you should see 'Checking' as it starts connecting. If everything worked you should see `New DataChannel foo 1`

Now you can put whatever you want in the `Message` textarea, and when you hit `Send Message` it should appear in your terminal!
Expand Down
11 changes: 11 additions & 0 deletions examples/examples/insertable-streams/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# insertable-streams

insertable-streams demonstrates how to use insertable streams with WebRTC.rs.
This example modifies the video with a single-byte XOR cipher before sending, and then
decrypts in Javascript.
Expand All @@ -7,33 +8,43 @@ insertable-streams allows the browser to process encoded video. You could implem
E2E encyption, add metadata or insert a completely different video feed!

## Instructions

### Create IVF named `output.ivf` that contains a VP8 track

```shell
ffmpeg -i $INPUT_FILE -g 30 output.ivf
```

### Build insertable-streams

```shell
cargo build --example insertable-streams
```

### Open insertable-streams example page

[jsfiddle.net](https://jsfiddle.net/uqr80Lak/) you should see two text-areas and a 'Start Session' button. You will also have a 'Decrypt' checkbox.
When unchecked the browser will not decrypt the incoming video stream, so it will stop playing or display certificates.

### Run insertable-streams with your browsers SessionDescription as stdin

The `output.ivf` you created should be in the same directory as `insertable-streams`. In the jsfiddle the top textarea is your browser, copy that and:

#### Linux/macOS

Run `echo $BROWSER_SDP | ./target/debug/examples/insertable-streams`

#### Windows

1. Paste the SessionDescription into a file.
1. Run `./target/debug/examples/insertable-streams < my_file`

### Input insertable-streams's SessionDescription into your browser

Copy the text that `insertable-streams` just emitted and copy into second text area

### Hit 'Start Session' in jsfiddle, enjoy your video!

A video should start playing in your browser above the input boxes. `insertable-streams` will exit when the file reaches the end.

To stop decrypting the stream uncheck the box and the video will not be viewable.
Expand Down
5 changes: 5 additions & 0 deletions examples/examples/offer-answer/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# offer-answer

offer-answer is an example of two webrtc-rs or pion instances communicating directly!

The SDP offer and answer are exchanged automatically over HTTP.
The `answer` side acts like a HTTP server and should therefore be ran first.

## Instructions

First run `answer`:

```shell
cargo build --example answer
./target/debug/examples/answer
```

Next, run `offer`:

```shell
cargo build --example offer
./target/debug/examples/offer
Expand Down
6 changes: 6 additions & 0 deletions examples/examples/ortc/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ortc

ortc demonstrates WebRTC.rs's [ORTC](https://ortc.org/) capabilities. Instead of using the Session Description Protocol
to configure and communicate ORTC provides APIs. Users then can implement signaling with whatever protocol they wish.
ORTC can then be used to implement WebRTC. A ORTC implementation can parse/emit Session Description and act as a WebRTC
Expand All @@ -7,20 +8,25 @@ implementation.
In this example we have defined a simple JSON based signaling protocol.

## Instructions

### Build ortc

```shell
cargo build --example ortc
```

### Run first client as offerer

`ortc --offer` this will emit a base64 message. Copy this message to your clipboard.

## Run the second client as answerer

Run the second client. This should be launched with the message you copied in the previous step as stdin.

`echo BASE64_MESSAGE_YOU_COPIED | ortc`

### Enjoy

If everything worked you will see `Data channel 'Foo'-'' open.` in each terminal.

Each client will send random messages every 5 seconds that will appear in the terminal
Expand Down
11 changes: 11 additions & 0 deletions examples/examples/play-from-disk-h264/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,45 @@
# play-from-disk-h264

play-from-disk-h264 demonstrates how to send h264 video and/or audio to your browser from files saved to disk.

## Instructions

### Create IVF named `output.264` that contains a H264 track and/or `output.ogg` that contains a Opus track

```shell
ffmpeg -i $INPUT_FILE -an -c:v libx264 -bsf:v h264_mp4toannexb -b:v 2M -max_delay 0 -bf 0 output.h264
ffmpeg -i $INPUT_FILE -c:a libopus -page_duration 20000 -vn output.ogg
```

### Build play-from-disk-h264

```shell
cargo build --example play-from-disk-h264
```

### Open play-from-disk-h264 example page

[jsfiddle.net](https://jsfiddle.net/9s10amwL/) you should see two text-areas and a 'Start Session' button

### Run play-from-disk-h264 with your browsers SessionDescription as stdin

The `output.h264` you created should be in the same directory as `play-from-disk-h264`. In the jsfiddle the top textarea is your browser, copy that and:

#### Linux/macOS

Run `echo $BROWSER_SDP | ./target/debug/examples/play-from-disk-h264 -v examples/test-data/output.h264 -a examples/test-data/output.ogg`

#### Windows

1. Paste the SessionDescription into a file.
1. Run `./target/debug/examples/play-from-disk-h264 -v examples/test-data/output.h264 -a examples/test-data/output.ogg < my_file`

### Input play-from-disk-h264's SessionDescription into your browser

Copy the text that `play-from-disk-h264` just emitted and copy into second text area

### Hit 'Start Session' in jsfiddle, enjoy your video!

A video should start playing in your browser above the input boxes. `play-from-disk-h264` will exit when the file reaches the end

Congrats, you have used WebRTC.rs!
8 changes: 7 additions & 1 deletion examples/examples/play-from-disk-renegotiation/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
# play-from-disk-renegotiation

play-from-disk-renegotiation demonstrates WebRTC.rs's renegotiation abilities.

For a simpler example of playing a file from disk we also have [examples/play-from-disk](/examples/play-from-disk)

## Instructions

### Build play-from-disk-renegotiation

```shell
cargo build --example play-from-disk-renegotiation
```

### Create IVF named `output.ivf` that contains a VP8 track

```shell
ffmpeg -i $INPUT_FILE -g 30 output.ivf
```

### Run play-from-disk-renegotiation
The `output.ivf` you created should be in the same directory as `play-from-disk-renegotiation`.

The `output.ivf` you created should be in the same directory as `play-from-disk-renegotiation`.


### Open the Web UI

Open [http://localhost:8080](http://localhost:8080) and you should have a `Add Track` and `Remove Track` button. Press these to add as many tracks as you want, or to remove as many as you wish.

Congrats, you have used WebRTC.rs!
Loading

0 comments on commit 0186b0a

Please sign in to comment.