A single static page app so that we can easily understand how to use the WebRTC API to establish communication between two peers.
Prerequisites:
- Node.js and npm (or yarn) installed on your system. You can check by running
node -v
andnpm -v
(oryarn -v
) in your terminal.
Demo
Instructions:
-
Clone the repository:
git clone [https://github.com/denilgabani/sample-webrtc-app.git](https://github.com/denilgabani/sample-webrtc-app.git)
-
Navigate to the project directory:
cd sample-webrtc-app
- Install dependencies:
npm install
- Run the development server:
npm start
- Open the app in two browser windows:
Open http://localhost:3000 in two separate browser windows to simulate two users in a video call.
Additional notes:
- This is a basic example and does not implement security features like encryption.
- You may need to allow camera and microphone access in your browser settings for the video call to function properly.
Further resources:
The blog post explaining the code: https://blog.denilgabani.com/a-simple-webrtc-app WebRTC documentation: https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API