Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maitrungduc1410/WebRTC-Demo

WebRTC demo on Web, Android and iOS
https://github.com/maitrungduc1410/WebRTC-Demo

Last synced: 3 months ago
JSON representation

WebRTC demo on Web, Android and iOS

Awesome Lists containing this project

README

        

# WebRTC-Demo


A comprehensive WebRTC demo on Web, Android and iOS






# Features
- Up-to-date with latest WebRTC API. Currently using M125
- ✅ Audio control
- ✅ Video control
- ✅ Switch front/back camera
- ✅ Switch between microphone vs Speaker
- ✅ Send message using data channel
- ✅ Screen sharing. All except iOS
- End to end encryption. Only Web is supported. Native is in progress...([see below](#end-to-end-encryption))
- Stream video file. In progress...

# Disclaimer
This is intended to show common use cases of WebRTC cross platforms and to give you some ideas, it may have bugs, use with caution!

# Setup
## Start signaling server
First you need to start the signaling server, Open terminal at `signaling-server` and run:
```
npm install # or yarn install (to install dependencies)
npm run dev # or yarn dev
```
Once started the address of signling server will be printed in your terminal

## Start clients
The usage of all clients are same, you just need to join clients in same room by input same roomID.

### Web
To start web client, open terminal at `web` and run:
```
npm install

npm run dev
```
Then open 2 browsers at `localhost:5173` to test

### Android

Change the value of `serverAddress` in `android/app/src/main/res/values/strings.xml` to server IP which is printed when you start the signaling server

### iOS

First run the following command in `ios` folder:
```
pod install
```

Then change `SERVER_URL` in `CallViewController` to signaling server address

# Troubleshooting

## iOS - Compiling for iOS 11.0, but module...

Change Minimum Deployments of the pod that has issue to latest

## iOS - Sandbox: rsync.samba(13105)...

Solution: Update your Xcode project build option ENABLE_USER_SCRIPT_SANDBOXING to 'No'.

# End-to-end encryption

> [!NOTE]
> Currently only supported for Web-Web communication

Under `web/src/App.vue`, set `enableE2EE=true` to enable E2EE

By default, E2EE use Web Worker for encrypt/decrypt, if you want to do that on Main thread then set `useEncryptionWorker=false`

If you want to verify if E2EE is working, turn on `shouldSendEncryptionKey=true`, then the remote peer won't receive encryptionKey and it will show raw video which is encrypted and not visible