This project implements a simple WebRTC-based video communication system using React + Vite.
Before you begin, ensure you have:
- Node.js (v16 or later) installed
- npm or yarn installed
-
Clone the repository:
git clone https://github.com/your-repo/webrtc-react-vite.git cd webrtc-react-vite -
Install dependencies:
npm install # or yarn install -
Run the development server:
npm run dev # or yarn dev -
Open the app:
- The app will be available at
http://localhost:5173(or another port if assigned by Vite).
- The app will be available at
- Open the WebRTC app in two separate browser windows/tabs.
- These will act as Peer 1 and Peer 2.
- Click "Create Offer" on Peer 1.
- Copy the generated Offer SDP from the textarea.
- Paste it into the Offer field of Peer 2.
- Click "Create Answer" on Peer 2.
- Copy the generated Answer SDP from the textarea.
- Paste it into the Answer field of Peer 1.
- Click "Add Answer" on Peer 1.
- If successful, both peers should now see each other's video streams!
- Ensure your browser has camera and microphone access enabled.
- If no video appears, check the browser console for any WebRTC errors.
- Ensure both peers are using the same offer/answer exchange.
- If using different networks, you may need to set up a TURN server.
This project is open-source and free to use.
Enjoy coding! 🚀