-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New repo that contains applications that use 3rd party libraries
- Loading branch information
Showing
26 changed files
with
185 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
# Unshallow the repo, this check doesn't work with this enabled | ||
# https://github.com/travis-ci/travis-ci/issues/3412 | ||
if [ -f $(git rev-parse --git-dir)/shallow ]; then | ||
git fetch --unshallow || true | ||
fi | ||
|
||
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | ||
|
||
EXCLUDED_CONTIBUTORS=('John R. Bradley') | ||
MISSING_CONTIBUTORS=() | ||
|
||
shouldBeIncluded () { | ||
for i in "${EXCLUDED_CONTIBUTORS[@]}" | ||
do | ||
if [ "$i" == "$1" ] ; then | ||
return 1 | ||
fi | ||
done | ||
return 0 | ||
} | ||
|
||
|
||
IFS=$'\n' #Only split on newline | ||
for contributor in $(git log --format='%aN' | sort -u) | ||
do | ||
if shouldBeIncluded $contributor; then | ||
if ! grep -q "$contributor" "$SCRIPT_PATH/../README.md"; then | ||
MISSING_CONTIBUTORS+=("$contributor") | ||
fi | ||
fi | ||
done | ||
unset IFS | ||
|
||
if [ ${#MISSING_CONTIBUTORS[@]} -ne 0 ]; then | ||
echo "Please add the following contributors to the README" | ||
for i in "${MISSING_CONTIBUTORS[@]}" | ||
do | ||
echo "$i" | ||
done | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
display_commit_message_error() { | ||
cat << EndOfMessage | ||
$1 | ||
------------------------------------------------- | ||
The preceding commit message is invalid | ||
it failed '$2' of the following checks | ||
* Separate subject from body with a blank line | ||
* Limit the subject line to 50 characters | ||
* Capitalize the subject line | ||
* Do not end the subject line with a period | ||
* Wrap the body at 72 characters | ||
EndOfMessage | ||
|
||
exit 1 | ||
} | ||
|
||
lint_commit_message() { | ||
if [[ "$(echo "$1" | awk 'NR == 2 {print $1;}' | wc -c)" -ne 1 ]]; then | ||
display_commit_message_error "$1" 'Separate subject from body with a blank line' | ||
fi | ||
|
||
if [[ "$(echo "$1" | head -n1 | wc -m)" -gt 50 ]]; then | ||
display_commit_message_error "$1" 'Limit the subject line to 50 characters' | ||
fi | ||
|
||
if [[ ! $1 =~ ^[A-Z] ]]; then | ||
display_commit_message_error "$1" 'Capitalize the subject line' | ||
fi | ||
|
||
if [[ "$(echo "$1" | awk 'NR == 1 {print substr($0,length($0),1)}')" == "." ]]; then | ||
display_commit_message_error "$1" 'Do not end the subject line with a period' | ||
fi | ||
|
||
if [[ "$(echo "$1" | awk '{print length}' | sort -nr | head -1)" -gt 72 ]]; then | ||
display_commit_message_error "$1" 'Wrap the body at 72 characters' | ||
fi | ||
} | ||
|
||
if [ "$#" -eq 1 ]; then | ||
if [ ! -f "$1" ]; then | ||
echo "$0 was passed one argument, but was not a valid file" | ||
exit 1 | ||
fi | ||
lint_commit_message "$(sed -n '/# Please enter the commit message for your changes. Lines starting/q;p' "$1")" | ||
else | ||
# TRAVIS_COMMIT_RANGE is empty for initial branch commit | ||
if [[ "${TRAVIS_COMMIT_RANGE}" != *"..."* ]]; then | ||
parent=$(git log -n 1 --format="%P" ${TRAVIS_COMMIT_RANGE}) | ||
TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE}...$parent" | ||
fi | ||
|
||
for commit in $(git rev-list ${TRAVIS_COMMIT_RANGE}); do | ||
lint_commit_message "$(git log --format="%B" -n 1 $commit)" | ||
done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | ||
GO_REGEX="^[a-zA-Z_]+\.go$" | ||
|
||
find "$SCRIPT_PATH/.." -name "*.go" | while read fullpath; do | ||
filename=$(basename -- "$fullpath") | ||
|
||
if ! [[ $filename =~ $GO_REGEX ]]; then | ||
echo "$filename is not a valid filename for Go code, only alpha and underscores are supported" | ||
exit 1 | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
sfu-ws/cert.pem | ||
sfu-ws/key.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
linters-settings: | ||
govet: | ||
check-shadowing: true | ||
misspell: | ||
locale: US | ||
|
||
linters: | ||
enable-all: true | ||
disable: | ||
- lll | ||
- gochecknoinits | ||
- gochecknoglobals | ||
|
||
issues: | ||
exclude-use-default: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
env: | ||
- GO111MODULE=on | ||
|
||
before_script: | ||
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.15.0 | ||
|
||
script: | ||
- golangci-lint run | ||
- bash .github/assert-contributors.sh | ||
- bash .github/lint-commit-message.sh | ||
- bash .github/lint-filename.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,38 @@ | ||
<h1 align="center"> | ||
Examples | ||
Examples WebRTC Applications | ||
</h1> | ||
|
||
We've build an extensive collection of examples covering common use-cases. You can modify and extend these examples to quickly get started. | ||
The following are a collection of example applications built by Pion users. These applications show real world usage of Pion, | ||
and should serve as a good starting point for your next project. For more minimal examples check out [examples](https://github.com/pion/webrtc/tree/master/examples) in the Pion WebRTC repository | ||
|
||
### Overview | ||
#### Media API | ||
If you have a request please make an issue, we also love contributions more examples are always welcome. | ||
|
||
Have any questions? Join [the Slack channel](https://pion.ly/slack) to follow development and speak with the maintainers. | ||
|
||
## Examples | ||
* [Gstreamer Receive](gstreamer-receive): The gstreamer-receive example shows how to receive media from the browser and play it live. This example uses GStreamer for rendering. | ||
* [Gstreamer Send](gstreamer-send): Example gstreamer-send shows how to send video to your browser. This example uses GStreamer to process the video. | ||
* [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. | ||
* [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 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-ws): 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 Channels](data-channels): The data-channels example shows how you can send/recv DataChannel messages from a web browser. | ||
* [Data Channels Create](data-channels-create): Example data-channels-create shows how you can send/recv DataChannel messages from a web browser. The difference with the data-channels example is that the data channel is initialized from the server side in this example. | ||
* [Data Channels Close](data-channels-close): Example data-channels-close is a variant of data-channels that allow playing with the life cycle of data channels. | ||
* [Data Channels Detach](data-channels-detach): The data-channels-detach example shows how you can send/recv DataChannel messages using the underlying DataChannel implementation directly. This provides a more idiomatic way of interacting with Data Channels. | ||
* [Data Channels Detach Create](data-channels-detach-create): Example data-channels-detach-create shows how you can send/recv DataChannel messages using the underlying DataChannel implementation directly. This provides a more idiomatic way of interacting with Data Channels. The difference with the data-channels-detach example is that the data channel is initialized in this example. | ||
* [Pion to Pion](pion-to-pion): Example pion-to-pion is an example of two pion instances communicating directly! It therefore has no corresponding web page. | ||
* [ORTC](ortc): Example ortc shows how you an use the ORTC API for DataChannel communication. | ||
* [ORTC QUIC](ortc-quic): Example ortc-quic shows how you an use the ORTC API for QUIC DataChannel communication. | ||
* [Pion to Pion](pion-to-pion): Example pion-to-pion is an example of two pion instances communicating directly! It therefore has no corresponding web page. | ||
|
||
|
||
### Usage | ||
We've made it easy to run the browser based examples on your local machine. | ||
|
||
1. Build and run the example server: | ||
``` sh | ||
go get github.com/pion/webrtc | ||
cd $GOPATH/src/github.com/pion/webrtc/examples | ||
go get github.com/webrtc-example-applications | ||
cd $GOPATH/src/github.com/webrtc-example-applications | ||
go run examples.go | ||
``` | ||
|
||
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. | ||
|
||
### WebAssembly | ||
Some of our examples have support for WebAssembly. The same examples server documented above can be used to run the WebAssembly examples. However, you have to compile them first. This is done as follows: | ||
### Contributing | ||
Check out the **[contributing wiki](https://github.com/pion/webrtc/wiki/Contributing)** to join the group of amazing people making this project possible: | ||
|
||
1. If the example supports WebAssembly it will contain a `main.go` file under the `jsfiddle` folder. | ||
2. Build this `main.go` file as follows: | ||
``` | ||
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. | ||
4. Browse to [localhost](http://localhost). The page should now give you the option to run the example using the WebAssembly binary. | ||
### License | ||
MIT License - see [LICENSE](LICENSE) for full text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.