Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TannerGabriel/WebRTC-Video-Broadcast
WebRTC video/audio broadcast
https://github.com/TannerGabriel/WebRTC-Video-Broadcast
socket-io webrtc webrtc-call webrtc-video
Last synced: 3 months ago
JSON representation
WebRTC video/audio broadcast
- Host: GitHub
- URL: https://github.com/TannerGabriel/WebRTC-Video-Broadcast
- Owner: TannerGabriel
- License: mit
- Created: 2020-01-01T17:53:06.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-26T21:59:09.000Z (3 months ago)
- Last Synced: 2024-07-26T23:12:59.718Z (3 months ago)
- Topics: socket-io, webrtc, webrtc-call, webrtc-video
- Language: JavaScript
- Homepage:
- Size: 63.5 KB
- Stars: 515
- Watchers: 9
- Forks: 192
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-webrtc - WebRTC Video/Audio Broadcast - WebRTC video/audio broadcast. (Samples)
README
# WebRTC Video/Audio Broadcast
WebRTC PeerToPeer broadcast application that allows the broadcaster to send a video and audio stream to all connected users (watchers).
You can find the tutorial that explains the code and functionality on my [website](https://gabrieltanner.org/blog/webrtc-video-broadcast).
## Getting started
### Starting the application
Start the application using Node:
```bash
# Install dependencies for server
npm install# Run the server
node server
```Start the application using Docker:
```bash
# Building the image
docker build --tag webrtcvideobroadcast .# Run the image in a container
docker run -d -p 4000:4000 webrtcvideobroadcast
```### Testing the application
The application should now be running on your localhost:4000 and you test it by connecting to localhost:4000/broadcast.html to add a new broadcaster.
After that, you just need to visit localhost:4000 to connect to the server as a client and you should get the video that is streamed from the broadcaster.
## Adding a TURN server
A TURN server is used to relay traffic if a direct peer-to-peer connection fails and is required for most WebRTC applications since a direct connection is often not possible between two clients that aren't on the same network. This repository doesn't include the usage of a TURN server by default, but you can add one by commenting in the turn configuration in the `broadcast.js` and `watch.js` file and filling in your TURN credentials.
There are several options on how you can create your own TURN server. Here are just two common ones:
- [Coturn](https://github.com/coturn/coturn)
- [Golang WebRTC pion library TURN examples](https://github.com/pion/turn/tree/master/examples)You can also use TURN servers from cloud providers or other companies. Here is a [tutorial](https://gabrieltanner.org/blog/turn-server) that shows you how to set up Coturn and add a domain to your TURN server.
## Author
Gabriel Tanner
## Support me
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE) file for details