Build P2P (Peer to Peer) Video and Text Chat in Javascript Using Simple Peer and WebRTC Full Tutorial

You are currently viewing Build P2P (Peer to Peer) Video and Text Chat in Javascript Using Simple Peer and WebRTC Full Tutorial

 

Welcome folks today in this tutorial I will be talking about how to build a P2P (Peer to Peer) Video and text chat in Javascript Using Simple Peer and WebRTC . All the source code of the tutorial are given as follows. A step by step youtube video is shown below.

 

 

Get Started

 

In order to get started with this application we need to install the module bundler called as Browserify which will bundle all of our code into a single javascript file called as bundle.js.

 

npm i -g browserify

 

This will install browserify globally inside your system

 

Now go to your project directory and make a index.html file and copy paste the following code into it. First of all you need to install some dependencies for your project. Execute this command as follows

 

npm i simple-peer getusermedia

 

index.html

 

 

 

 

Now create your index.js file which will hold the logic of your application. All the javascript code will be there

 

 

Now make your bundle.js file by executing this command as follows

 

browserify index.js -o bundle.js

 

Leave a Reply