Giter Site home page Giter Site logo

tcscns / webrtc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from satishdhote1/backupwebrtc

0.0 1.0 0.0 51.98 MB

web real time communication platform

Home Page: https://ec2-52-66-78-44.ap-south-1.compute.amazonaws.com:8086/

JavaScript 79.53% HTML 15.62% CSS 4.82% Shell 0.03%

webrtc's Introduction

webrtc

web real time communication platform

alt webrtc development

![Gitter][GS image] Build Status Dependency Status NPM Status

This is a ready to deploy webrtc SDK and SaaS for a customized and flexible communication and collaboration solution .

SDK

Architecture

The Solution primarily contains nodejs frameworks for hosting the project and webbsockets over socket.io to perform offer - answer handshake and share SDP (Session description protocol ). alt webrtc development architecture

Technologies used
  1. WebRTC Web based real time communication framework. read more on webrtc

  2. Node (v5.0.0) Asynchronous event driven JavaScript runtime

  3. socket.io ( v0.9) Communication and signalling

Note : while its possible to use any prtotocol like SIP , XMPP , AJAX , JSON etc for this purpose , modifying thsi libabry will require a lot of rework . It would be advisble to start from apprtc directly in that case .

  1. Grunt It is a task Runner and its used to automate running of command in gruntfile
grunt -verbose

Get Started

To run this project following steps need to be followed in that order :

1. get the project from github
git clone https://github.com/altanai/webrtc.git webrtc
2. install nvm ( node version manager )
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | bash
. ~/.nvm/nvm.sh
nvm install v5.0.0
nvm use v5.0.0
3. install npm and update the dependencies

It will read the package.json and update the dependencies in node_modules folder on project location

	sudo apt-get install npm
	npm install 
4. Change ENV variables and Test

To change the ports for running the https server and rest server, goto env.json

{       
    "hostname"      : "host",        
	"enviornment"   : "local",        
	"host"        	: "localhost",
	"jsdebug"      :  true,          
	"httpsPort"    :  8086,
	"restPort"     :  8087,
    "extensionID"   : "elfbfompfpakbefoaicaeoabnnoihoac"
}

To run the tests

	npm test
5. Start up the Server

To start the Server in dev mode and stop the server as soon as Ctrl+ C is hit or the terminal widnow is closed .

	node webrtcserver.js

read more about node

To start the Server using npm start ( using package.json) , behaves same as earlier run using node. We use supervisor to restart the server incase of exceptions or new code .

	npm start
6. JS and CSS Libs

Make a webpage and give holders for video and button elements that SDK will use .

Inside the head tag of html minScripts/webrtcdevelopment_header.css minScripts/webrtcdevelopment_header.js

After the body tag of html minScripts/webrtcdevelopment.css minScripts/webrtcdevelopment.js

7. Configure

Create the webrtc dom object with local and remote objects

local object :

    var local={
        video: "myAloneVideo",              // name of the local video element
        videoClass:"",                      // class of the localvideo
        videoContainer : "singleVideoContainer", // outer container of the video element
        userDisplay:false,                  // do you want to display user details
        userMetaDisplay:false,
        userdetails:{                       //users details include name , emeial , color
            username: username,
            usercolor: "#DDECEF",
            useremail: useremail
        }
    };

remote object :

    var remote={
        videoarr: ["myConferenceVideo", "otherConferenceVideo"], // conatiners for the video after session is made 
                                                                // first one is usually the local video holder followed by remote video holders
        videoClass:"",
        maxAllowed: "6",
        videoContainer : "confVideoContainer",
        userDisplay:false,
        userMetaDisplay:false,
        dynamicVideos: false 
    };

Incoming and outgoing media configiration ( self exlanatory ) :

    var incoming={
        audio:  true,
        video:  true,
        data:   true,
        screen: true
    };

    var outgoing={
        audio:  true,
        video:  true,
        data:   true,
        screen: true
    };

    webrtcdomobj= new WebRTCdom(
        local, remote, incoming, outgoing
    );

Get session id automaically

sessionid = init(true);

or get session name from user

sessionid = init(false);

Create a session json object with turn credentials nd the session created from above step

set preference for the incoming and outgoing media connectection. Bydefault all are set to true .

    var incoming={
        audio:  true,
        video:  true,
        data:   true,
        screen: true
    };

    var outgoing={
        audio:  true,
        video:  true,
        data:   true,
        screen: true
    };

Set widgets and their properties . Currently available widgets are * Chat * Fileshare * Screen Record * Screen Share * Video Record * Snapshot * Draw on Canvas and Sync * Text Editor and Sync * Mute (audio amd video) * Reconnect

	var widgets={
	}

Initiate the webrtcdev contructor

    var webrtcdevobj = new WebRTCdev ( 
        session,  incoming,  outgoing ,  widgets
    );

Start the session

    startcall();
8. VOIP calls and conf

open tab on chrome or mozilla browser and add a link to the https server using nodejs script https://127.0.0.1:8086/multiparty_fullfeatures.html

Used Libs

Following are the additioanl libraries packed with the project

Gulp

Minify and concat the js and css files into minscripts

gulp
forever

Keeps running even when window is not active

cd WebCall
forever start webrtcserver.js
PM2

To start the Server using PM2 ( a process manager for nodejs)

License

MIT

webrtc's People

Contributors

altanai avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.