Skip to content

Commit

Permalink
updated readme and added license
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismatthieu committed Jul 1, 2013
1 parent 4157ddf commit f81f8b8
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2013 GetVocal Corporation (creators of Twelephone)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
rtcroulette
===========
RTC Roulette
============

WebRTC Chat Roulette is brought to you by the creators of Twelephone (htp://twelephone.com). It's written in Node.JS and uses web sockets to manage presence and Phono (http://phono.com) to manage the WebRTC signaling and call setup.

This project was developed by @ChrisMatthieu at the NodeConf 2013 hackathon. The concept was to build something similar to Chat Roulette but using modern HTML5 and WebRTC technology. Please feel free to send us feedback and pull requests!

WebRTC Chat Roulette
9 changes: 4 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ app.get('/getNext/:socket', function(req, res){
var userFilter = users.filter(function (user) { return user.socket == req.params.socket });
users.splice(users.indexOf(userFilter[0]), 1);


// Get first available key/jid to call
// delete user from KV (no longer available)
var nextUser = users.shift();
Expand Down Expand Up @@ -71,16 +70,16 @@ io.configure(function() {
io.sockets.on("connection", function(socket) {
socket.on("hello", function(jid) {
users.push({socket: socket.id.toString(), jid: jid});
console.log("connected: " + socket.id.toString() + " jid=" + jid);
console.log(users);
// console.log("connected: " + socket.id.toString() + " jid=" + jid);
// console.log(users);
});
socket.on("disconnect", function() {
var userFilter = users.filter(function (user) { return user.socket == socket.id.toString() });
if (userFilter && userFilter.length){
users.splice(users.indexOf(userFilter[0]), 1);
}
console.log("disconnected: " + socket.id.toString());
console.log(users);
// console.log("disconnected: " + socket.id.toString());
// console.log(users);
});
});

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"start": "app.js"
},
"version": "0.0.0-10",
"version": "0.0.0-11",
"engines": {
"node": "0.6.x"
},
Expand Down
20 changes: 3 additions & 17 deletions views/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ center
video#remoteVideo(width="100%", height="500px", autoplay="autoplay")
div#mini
video#miniVideo(width="250px", height="250px", autoplay="autoplay", muted="true")
//- img#videologo(alt="Twelephone", src="images/logo.png")
//- div.live LIVE
//- div#videofooter

.login-footer
ul.pull-left
Expand Down Expand Up @@ -46,7 +43,6 @@ script.
apiKey: "f12dc371538c973b3cb200b43b6c594d",
connectionUrl: "http://i-8f17cae0.phono.com:8080/http-bind",
onReady: function() {
// $("#call").attr("disabled", false).val("Call");
console.log("phono ready = " + phono.sessionId);
console.log("socket = " + socket.socket.sessionid);
myPhonoId = phono.sessionId;
Expand All @@ -68,9 +64,7 @@ script.
$(".elevator-pitch").show();
$(".elevator-pitch").html('Incoming call! Click the ALLOW button in the top/right of the page.');
call = event.call;
//- alert("Incoming call");
call.answer();
//- $(".elevator-pitch").hide()
call.bind({
onRing: function() {
//- $("#result").html("Ringing");
Expand All @@ -81,7 +75,6 @@ script.
},
onHangup: function(event) {
$("#result").html("Disconnected");
console.log(myPhonoId);
socket.emit("hello", myPhonoId);
}
});
Expand All @@ -91,27 +84,20 @@ script.

$(".login-button").click(function(event) {

$("#result").html('');
$(".elevator-pitch").hide()
/* stop form from submitting normally */
event.preventDefault();

/*clear result div*/
$("#result").html('');

/* get some values from elements on the page: */
var values = $(this).serialize();
//- console.log('>>>>>>>call clicked');

try {
call.hangup()
} catch (e){}

/* Send the data using post and put the results in a div */
/* Call next available participant */
$.ajax({
url: "/getNext/" + socket.socket.sessionid,
type: "get",
success: function(data){
console.log(data.jid);
if (data.jid) {
$("#result").html('Calling someone!');
call = phono.phone.dial("xmpp:" + data.jid, {
Expand All @@ -130,7 +116,7 @@ script.
});

} else {
$("#result").html("Wait for someone else to join.");
$("#result").html("Waitig for someone else to join.");
}

},
Expand Down
2 changes: 1 addition & 1 deletion views/layout.jade
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ html
meta(charset="utf-8")
meta(http-equiv="X-UA-Compatible", content="IE=edge,chrome=1")
title= title
meta(name="description", content="WebRTC Chat Roulette")
meta(name="description", content="WebRTC Chat Roulette - powered by Twelephone")
meta(name="author", content="Chris Matthieu")
meta(name="viewport", content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0")
meta(name="apple-mobile-web-app-capable", content="yes")
Expand Down

0 comments on commit f81f8b8

Please sign in to comment.