EzDevInfo.com

easyrtc

EasyRTC is a bundle of Open Source WebRTC joy! Our Javascript API hides the differences between Chrome and Firefox browsers and simplifies coding needed for working WebRTC apps. Signalling server using socket.io built on node.js. Tons of free code so you can build WebRTC apps in a few hours that just work. Demos include Instant messaging, Multip… EasyRTC - Open Source WebRTC tools for Enterprise Developers the fastest, most robust, easiest way to implement secure webrtc video, audio, and data applications for the enterprise.

Initialize on server side

I have created a Node Webkit application using SailsJS in back-end and AngularJS in front-end. I want to integrate audio-chat in my application using EasyRTC. I tried the demo application in my local. And it works fine. I am able to connect two users and do audio-chat. But when I started integrating the same in my application, I was unsuccessful. I could integrate the client-side but not the server-side. Here is my server side code:

var http    = require("http");              // http server core module
var express = require("express");           // web framework external module
var io      = require("socket.io");         // web socket external module
var easyrtc = require("easyrtc");           // EasyRTC external module

var httpApp = express();
httpApp.use(express.static(__dirname + "/static/"));
var webServer = server;
// Start Socket.io so it attaches itself to Express server
var socketServer = io.listen(webServer, {"log level":1});
// Start EasyRTC server
var rtc = easyrtc.listen(httpApp, socketServer);

I want to integrate this in my Sails code. But I am unable to do it because, when I start the application, the server will be running in 1337 port and I couldn't figure out where to write this code. Can anyone tell me how to fix my problem?

Any kind of help is appreciated. Thanks in advance.


Source: (StackOverflow)

Where is the Configure function for the Express module in EasyRTC

I'm new to NodeJS and maybe I'm putting the cart before the horse here, but I am attempting to run the demo of EasyRTC using NodeJS.

The EasyRTC download page has an "easy install instructions" list of actions to perform to run EasyRTC out of the box.

I encountered a problem with the second to last step - run server.js - upon attempting to run it I receive an error claiming that the httpApp.configure() function does not exist (TypeError: undefined is not a function). Now, httpApp is defined as require("express");, so I went over every file within /node_modules/express/lib and, as the error suggests, there is no configure function defined anywhere...

So, is this just me being a complete n00b and not knowing what I'm doing? I followed all of the steps in their example - and they aren't exactly obtuse instructions.

  1. download and install node.js
  2. download EasyRTC and place it anywhere you want
  3. get EasyRTC dependencies using npm
  4. run EasyRTC's server.js

    • (I skipped over the "create folder" and "navigate to folder" steps here because... c'mon)

Am I supposed to manually create the configure function for the express module? And if so, why do they claim that it runs "out of the box"?


Source: (StackOverflow)

Advertisements

CSS is not loading in easyrtc application on node.js

I've some css issues in my easyrtc application, Here is my physical file structure

  • project

    • login
      • css
        • style.css
      • js
        • script.css
      • login.html
      • logout.html
    • node_modules
    • static
      • server.js
      • package.json

In the server.js I've defined,

app.get('/', function(req, res, next) {
 res.redirect('/login');
});

and

app.get('/login', function(req, res, next) {
 res.sendfile('login.html', {root: './login'});
});

In my login.html I've include following link

<link rel="stylesheet" rel='nofollow' href="css/login.css" media="screen" type="text/css" />

Also I've tried with

<link rel="stylesheet" rel='nofollow' href="./login/css/login.css" media="screen" type="text/css" />

But this css file is not loading to browser, I've inspect the element. But there was an empty css file in sources. How can I fix this? What is the root of localhost:8080 my webserver running in port 8080 Although I go through the this nodejs express solution but I'm afraid can use this kind of solution for my existing project. If yes how can I add express middle-ware to load css? Help in advance. May the FOSS be with you.


Source: (StackOverflow)

dart proxy for easyrtc: type 'JsObject' is not a subtype of type 'JsFunction'

I'm experimenting some with easyrtc using dart. Following this the file would be something like this:

import 'dart:html';
import 'package:js/js.dart' as js;

var selfEasyrtcid = "";
var easyrtc;

void main() {
  easyrtc = new js.Proxy(js.context.easyrtc);
}

void something(){
  easyrtc.someFunction();
}

but when I try to run that in dartium it crashes with:

Exception: type 'JsObject' is not a subtype of type 'JsFunction' of 'constructor'. (package:js/js.dart:168) Breaking on exception: type 'JsObject' is not a subtype of type 'JsFunction' of 'constructor'.

What am I doing wrong here?


Source: (StackOverflow)

EasyRTC works only inside same LAN (ICE failed)

The problem is that the remote video can seen only if two computers are in same LAN Environment, namely from different ip's the remote video not seen and in the js console I get error ICE failed, see about:webrtc for more details.

I'm trying to search solution and found only that the problem may be because "ICE Candidates are received before answer is sent RemoteDescription should be set", but i have no idea how to correct it.

In part of other webrtc scripts, RTCMultiConnection for example not have this problem.

Any solution?

EasyRTC - http://easyrtc.com/download/

Running EasyRTC- http://wdd.co.il:8280

Update: my onIceCandidate

pc.onicecandidate = function(event) {
            if (newPeerConn.cancelled) {
                return;
            }
            var candidateData;
            if (event.candidate && peerConns[otherUser]) {
                candidateData = {
                    type: 'candidate',
                    label: event.candidate.sdpMLineIndex,
                    id: event.candidate.sdpMid,
                    candidate: event.candidate.candidate
                };

                if( iceCandidateFilter ) {
                   candidateData = iceCandidateFilter(candidateData, false);
                   if( !candidateData ) {
                      return;
                   }
                } 
                //
                // some candidates include ip addresses of turn servers. we'll want those 
                // later so we can see if our actual connection uses a turn server.
                // The keyword "relay" in the candidate identifies it as referencing a 
                // turn server. The \d symbol in the regular expression matches a number.
                // 
                if (event.candidate.candidate.indexOf("typ relay") > 0) {
                    var ipAddress = event.candidate.candidate.match(/(udp|tcp) \d+ (\d+\.\d+\.\d+\.\d+)/i)[2];
                    self._turnServers[ipAddress] = true;
                }

                if (peerConns[otherUser].connectionAccepted) {
                    sendSignalling(otherUser, "candidate", candidateData, null, function() {
                        failureCB(self.errCodes.PEER_GONE, "Candidate disappeared");
                    });
                }
                else {
                    peerConns[otherUser].candidatesToSend.push(candidateData);
                }
            }
        };

Source: (StackOverflow)

How to connect two users directly using WebRTC

I have this code that creates a button for every user that is logged into my WebRTC page. When clicked this button allows two users to view each other (VideoChat).

function connect()
{
    easyrtc.setVideoDims(720,720);
    easyrtc.enableDebug(false);
    easyrtc.setRoomOccupantListener(convertListToButtons);
    easyrtc.easyApp("easyrtc.videoChatHd", "selfVideo", ["callerVideo"], loginSuccess, loginFailure);
    easyrtc.setUserName('user1');
}

function convertListToButtons (roomName, data, isPrimary)
{
    clearConnectList();
    var otherClientDiv = document.getElementById('otherClients');

    for(var easyrtcid in data)
    {        
        var button = document.createElement('button');
        button.onclick = function(easyrtcid)
        {
            return function()
            {
                performCall(easyrtcid);
            };
        }(easyrtcid);

        var label = document.createTextNode(easyrtc.idToName(easyrtcid));
        button.appendChild(label);
        button.className = "callbutton";
        otherClientDiv.appendChild(button);
    }
}

I am trying to avoid having that button and using my database to determine who connects to who automatically.

The database looks like this:

User(macAddress, otherUserMac)

Since the easyrtcid is generated at random, how can I set the easyrtcid to the value I will read from the database? I tried setting the username but that didn't help. Or maybe there is an easier way, I do have the user's mac address, but it seems that I can't check that again in JavaScript.


Source: (StackOverflow)

Get remote stream with out peer connection using Easyrtc

I am using easyrtc for a video chat application. i have to get someone stream before peer connection.Now geting remote video on after call but i have to get remote stream before calling. is it possible? how to get remote stream?


Source: (StackOverflow)

How to replace auto generated easyrtc id with your applications username in easyrtc application

I am developing one application using easyrtc tool with wavemaker tool.For a new user easy rtc provides automatically created easyrtc id. In the chat window the random id are shown..i want to replace these ids with applications username..

I have find one solution where we have to set easyrtc.setUsername("") in client js file before calling easyrtc.connect function.. But this not solves the problem...

any help would be appriciated


Source: (StackOverflow)

EasyRTC - Screen sharing not working

I was working with EasyRTC to implement audio-chat and screen-sharing using Node-Webkit. Audio-call is working perfectly but screen-sharing is not. I tried the demos that they have provided. It's giving me getUserMediaError. When I searched on internet I also found that newest google chrome versions don't support the feature of screen-sharing. Can someone tell me how I can implement screen-sharing in my application?


Source: (StackOverflow)

How to configure Easyrtc Application in Apache Tomcat?

I have developed one easyrtc application . Easyrtc(Node Server) run on 9090 port and apache tomcat run on 8443 port. I have deployed this application on apache tomcat server using easyrtc.setSocketUrl(":9090"); I am able access application on node server using https://localhost:9090/demos/demo_instant_messaging.html and on apche tomcat as https://localhost:8443/demos/demo_audio_video_simple.html. It is working fine on localhost......

On the apche tomcat server in demos folder i have replaced following lines EasyRTC Demo: Simple Video+Audio

<!--hide-->
<link rel="stylesheet" type="text/css" rel='nofollow' href="css/landing.css" />
<link rel="stylesheet" type="text/css" rel='nofollow' href="css/demo_audio_video_simple.css" />
<!-- Prettify Code -->
<script type="text/javascript" src="js/prettify/prettify.js"></script>
<script type="text/javascript" src="js/prettify/loadAndFilter.js"></script>
<script type="text/javascript" src="js/prettify/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" rel='nofollow' href="js/prettify/prettify.css" />

<!--show-->
<!-- Assumes global locations for socket.io.js and easyrtc.js -->
     <script src="//localhost:9090/socket.io/socket.io.js"></script> 
<script type="text/javascript" src="//localhost:9090/easyrtc/easyrtc.js"></script>
<script type="text/javascript" src="js/demo_audio_video_simple.js"></script>

And in the JS file i have replaced easyrtc.setSocketUrl(":9090");

So in my production enviorment we have deployed apache tomcat server and i have this application on this server But now when i accessing this from my client machine the code wriiten in html file is not able to reolve the machine . It cant resolve localhost:9090

. Due to some limitation we dont have access to the port 9090 on client machine.The servers 9090 port is not open for client machine Is there any way that i can remove the reference of //localhost:9090 by moving any files on the server side..??????? Is there any way that i acn access easyrtc server side code without giving this kind of reference.?????

The above code is working fine on server machine itself.


Source: (StackOverflow)

How to Get media for webRTC in webview?

I Run an app that let you start voice chat with webRTC (it based in easyRTC) when I call my page from android browser it ask for get media resource and then start chat ... enter image description here However when I Call my webpage in android webview does not get request for media , the Error : Failed to get access to local media Error code was permissionDeniedError !

in manifest i add these permissions :

 <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

I know it just support in android L or later webview in android L and I test the sample in that Link ! But I can not run it !


Source: (StackOverflow)

In EasyRTC, how to handle when handshake fail

plz help me to solve following issue:

In handshake between User1 and User2 for a peer connection (1->2->3->4), the User1 is disconnected suddenly like following:

[User1] ---(1)offer---> [Signaling server] ---(2)offer---> [User2]
[User1] <--(4)anwser--- [Signaling server] <--(3)anwser--- [User2]

After step (1), User1 is disconnected. So step (4) is fail.

Form now, although User1 refreshs to reconnect with any new easyrtcIds, but User2 still wait for User1 with old easyrtcId. So it rejects any incoming offers. Therefore they can't connect together.

How can I catch and handle this case?


Source: (StackOverflow)

EasyRTC Download Conversation

Im developing video chat/conferance application on node.js.I want to download conversation after video chat/conferance.How can I download EasyRTC Video Chat/Conferance conversation.Is it possible? Thanks.


Source: (StackOverflow)

Node.js How to Rewrite URL in server.js

I am using node.js with easyrtc and need to rewrite url or remove any url after slash

please find my server.js

var http    = require("http");         
var express = require("express");      
var io      = require("socket.io");    
var easyrtc = require("easyrtc");      
var httpApp = express();
httpApp.configure(function() {
httpApp.use(express.static(__dirname + "/static/"));
});
var webServer = http.createServer(httpApp).listen(9099);
var socketServer = io.listen(webServer, {"log level":5});
var rtc = easyrtc.listen(httpApp, socketServer);

where can I add the script to rewrite url ?


Source: (StackOverflow)

EasyRTC - Associate custom userID to socketID

I am creating a desktop application using Node-Webkit. I am trying to integrate audio-chta within it using EasyRTC. I integrated it, and it works fine. I want to set custom userID with every users socketID. But I am not sure how to do it. I tried giving easyrtc.setUsername('my-name'). But I found that this will not get affected in the other clients client list. Can anyone suggest me a method on how to do the same?

Thanks in advance.


Source: (StackOverflow)