easyRTC with Meteor

988 views
Skip to first unread message

lucask...@gmail.com

unread,
Jan 2, 2014, 1:40:55 PM1/2/14
to eas...@googlegroups.com
I was using OpenTok previously, but I do not like their documentation, plus I love that your software is open source.

However, I use the Meteor framework, and am not exactly sure how to get it to integrate. Any resources would be appreciated.

Rod Apeldoorn

unread,
Jan 2, 2014, 2:23:11 PM1/2/14
to
Here's an answer I just adopted from someone looking to use the geddy framework.

Currently EasyRTC is tied to Express, but fairly loosely. The newer module code in v1.0 only uses it in a few locations.
  • Hosting of Client API
  • Hosting of demos
  • Providing unique session identifier
  • Cookies
A fork of the EasyRTC code to support Meteor instead of Express could probably be made in a day. The biggest issue would be one of upkeep.

A few options available now:
  1. Create a separate server for EasyRTC on a different port used only for signalling. Here are some instructions.
  2. Create a Node.js application which uses Meteor except for requests to /easyrtc/* and /socket.io/* where Express is used. (not 100% sure if it's easily doable)
  3. Fork EasyRTC and hack it to accept Meteor framework. Search on "httpApp", "req." and "res." for potential trouble spots.
I'm not too keen on supporting multiple frameworks in the core code base for now, but I can see the benefits. If there turns out to be a huge need, or if we get sponsored to do it, this could easily change.

Rod Apeldoorn,
EasyRTC Server Lead,

lucask...@gmail.com

unread,
Jan 2, 2014, 11:28:13 PM1/2/14
to eas...@googlegroups.com
While I'm not 100% tied to Meteor overall, I have been spending a lot of time working with it. 

However WebRTC is going to be the core of the app, so I would be more interested in going where that support is, as cohesive and fun as Meteor is..

It sounds similar to OpenTok in the sense there is the session id creation component, handled by a server (in this case, your own server provides it, as opposed to the TokBox server that all traffic runs through). Since that is the core of WebRTC, correct?

Do you guys have CDN'd Client API's somewhere?


Rod Apeldoorn

unread,
Jan 3, 2014, 12:34:38 PM1/3/14
to eas...@googlegroups.com
It sounds similar to OpenTok in the sense there is the session id creation component, handled by a server (in this case, your own server provides it, as opposed to the TokBox server that all traffic runs through). Since that is the core of WebRTC, correct?

The session id isn't a core WebRTC requirement. It's just a way for the server to keep track of visitors across requests. This is a requirement for many web applications, but not WebRTC itself.

Do you guys have CDN'd Client API's somewhere?

Not yet, but it is a great idea worth exploring. If anyone knows of a cost effective CDN host with good worldwide coverage and SSL support let me know.

lucask...@gmail.com

unread,
Jan 5, 2014, 7:14:49 PM1/5/14
to eas...@googlegroups.com
How about CDNJS?


I usually look there first.

I wouldn't be against helping/maintaining something like this in the long run, I just need to find out if easyRTC is the framework for me.

Problem is, I understand Meteor mostly, since it is full stack a lot of implementation stuff is taken care of for me (I can then just write content/html/routing functions), but Node in general I don't really know how to develop with.

If I just add the Client libraries, can I still get a room based video chat sessions to work? What is required for easyrtc to function?

Eric Davies

unread,
Jan 7, 2014, 11:27:35 AM1/7/14
to eas...@googlegroups.com
If I understand correctly, you want the meteor framework to be serving your pages while still using EasyRTC. In theory, this should be the same situation as someone using apache to serve their pages and EasyRTC for the signalling. In short, it shouldn't pose a problem. If meteor uses websocket (in particular socket.io), you'll want to grab the latest beta branch. Then simply run nodejs and attach it to a different port than the meteor framework is being served on. As long as the meteor framework doesn't get in your way of defining video tags, you should be able to include and use the client side libraries without any difficulty. 

Eric Davies, EasyRTC browser client guy.

lucask...@gmail.com

unread,
Jan 7, 2014, 7:54:08 PM1/7/14
to eas...@googlegroups.com
Basically, yes. The thing is that Meteor is a little bit different that straight up Node.js, and I am not sure exactly how to get a Node server running concurrently with Meteor. My attempts have been fruitless, lol.

Meteor does not use socket.io, rather SocksJS. Since its a full stack framework, I don't understand how you "just simply run nodejs" since Meteor starts up the server for you.


Eric Davies

unread,
Jan 7, 2014, 11:07:23 PM1/7/14
to eas...@googlegroups.com
There may be a cleaner meteor ways of doing things, but from my classic client server view, the can't fail path is that you treat easyrtc as a separate webservice that just happens to be running on the same machine as your meteor's nodejs:

You start a process running node.js using our instructions, assigning a port like 8080. That handles the server side as far as we're concerned.

You then start/deploy your meteor application. It runs a nodejs in a separate process, assigned to a different port, like 80.  In the head of your html files you include our easyrtc.js client api and socket.io, plus whatever functions you write on top of them so that they stay on the client. You just have tell the easyrtc client what port you are using for the EasyRTC server.






Karl Martin Lind

unread,
Jul 21, 2015, 5:22:36 PM7/21/15
to EasyRTC
Hi Eric,
I talked to Dough last week and we are excited to hear that you will soon be offering a native iOS SDK.

You write:
"In the head of your html files you include our easyrtc.js client api and socket.io, plus whatever functions you write on top of them so that they stay on the client. You just have tell the easyrtc client what port you are using for the EasyRTC server."

Can you please elaborate on this a bit, for example in code, how would you do this if it wasn't Meteor?  If you know Meteor, an example would be even better !

thanks,

K

Eric Davies

unread,
Jul 21, 2015, 5:41:05 PM7/21/15
to EasyRTC
I think you mean Doug rather than Dough :-).

I have no background with Meteor, so I can't offer any meteor specific instructions. 

The detail instructors for running easyrtc with other webservers can be found here:


Karl Martin Lind

unread,
Jul 23, 2015, 11:44:10 AM7/23/15
to eas...@googlegroups.com, eric....@priologic.com
Hi Eric,

yes thanks.

I am trying have the two servers communicate, I installed socket.io, copied the easyrtc.js file to the Meteor server, and set    

easyrtc.setSocketUrl(":8080");

However, Meteor does not allow me to use:
<body onload = "connect();">

So I have to use a template method  to run the connect function once it is fully loaded into the DOM:
Template.easyrtcSimple1.created = function(){
    connect
();
}

But I get the error:  The monitor video id passed to easyApp was bad, saw selfVideo
What exactly is that referring to (line 5068 in easyrtc.js) ? 

easyrtc.js:5137 also throws an error :
if (!_validateVideoIds(monitorVideoId, videoIdsP)) {
     
throw "bad video element id";
}


In connect(); I use the same app name as you have.  Is that ok?
    easyrtc.easyApp("easyrtc.audioVideoSimple", "selfVideo", ["callerVideo"], loginSuccess, loginFailure);

I have stripped down the html file and made sure it worked locally on easyrtc server first (after removing the template tag, {{runConnect}} and adding in onload:
<template name = "easyrtcSimple1">
    
<div id="container">
        
<div id="main">
            
<div id="demoContainer">
               
<div id="connectControls">
                   
<div id="iam">Not yet connected...</div>
                   
<br />
                   
<strong>Connected users:</strong>
                   
<div id="otherClients"></div>
               
</div>

               
<div id="videos">
                   
<video autoplay="autoplay" class="easyrtcMirror" id="selfVideo" muted="muted" volume="0" ></video>
                   
<div style="position:relative;float:left;">
                   
<video autoplay="autoplay" id="callerVideo"></video>

                    </div>
               
</div>
         
</div>
     
</div>
   
</div>
</template>


Thanks,

Karl
Reply all
Reply to author
Forward
0 new messages