Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
6ce5c27
Initial commit
Jul 31, 2012
a3e761f
now giving the socket.io and client fils
Jul 31, 2012
ca5a103
new style and fullscreen
Jul 31, 2012
d69cfa1
git fork and new readme
Jul 31, 2012
6d169d5
remove of script
Jul 31, 2012
5733cb9
fix readme
Jul 31, 2012
22e6fc8
added rooms and abstracted away the server code
Aug 2, 2012
0e5f6cc
serve client from server automatecly
Aug 2, 2012
5a47c82
setup for deployment
Aug 2, 2012
c3e8821
update the readme
Aug 3, 2012
1c2de92
remove of unused files
Aug 3, 2012
8230f9b
chanched for localhost use
Aug 3, 2012
c4d4e8f
new instructions on how to setup in the readme
Aug 3, 2012
dbb8a4c
fix the ``` int the readme
Aug 3, 2012
6aa8b56
fix the ``` int the readme
Aug 3, 2012
85749d5
fix the ``` int the readme
Aug 3, 2012
2ba24fa
add stuff for demo
benbrittain Aug 3, 2012
b1b4542
added message if peerconnection is not supported
Aug 3, 2012
ef3087d
make local video mirror
benbrittain Aug 4, 2012
824ee97
make local remote video not mirror
benbrittain Aug 4, 2012
77d2b73
chanched to use the new callback API
Aug 4, 2012
6bfef44
update of fork in index
Aug 4, 2012
421d599
updated readme
Aug 6, 2012
728098c
add /#1 in the readme links
Aug 6, 2012
c002a3c
setup for loack use
Aug 6, 2012
e6cad94
edited for use with the only websocket part
Aug 7, 2012
2e20bc7
fix for issue 1
Aug 7, 2012
394459a
remove socket.io dependenc and remove of auto set room
Aug 8, 2012
d6338f5
added remove of socket.id from room on close
Aug 8, 2012
239f033
update for 0.0.1 release
benbrittain Aug 10, 2012
31e6a74
update for 0.0.1 release
benbrittain Aug 10, 2012
226ef3a
added chat
Aug 10, 2012
61a0fa1
fixed chat repeat
Aug 10, 2012
e7fedbb
clean up some log
Aug 10, 2012
7e974e2
add dependency
Aug 10, 2012
8feb295
symlink the clientside code
benbrittain Aug 10, 2012
36036ac
Merge pull request #2 from webRTC/websocket
benbrittain Aug 10, 2012
c1e2d60
removed nodejitsu thinks
Aug 10, 2012
308684d
Merge branch 'master' of https://github.com/webRTC/webrtc.io-demo
Aug 11, 2012
effe583
fix websocket problems with lisen to server
Aug 11, 2012
a404d7a
bump version num and clean up NPM
benbrittain Aug 11, 2012
04fd812
chance of api fic
Aug 11, 2012
d1ea339
fix for ln -s
Aug 14, 2012
64b00fe
fix symlink
Aug 14, 2012
30c1ede
add .swp to gitignore
Aug 18, 2012
e6bfa10
added suport of Chrome Version 25.0.1323.0 canary
coderaiser Nov 12, 2012
b7446ff
Merge pull request #6 from coderaiser/patch-1
benbrittain Nov 19, 2012
3daa35d
Update example/index.html
feiyunruyue Jan 11, 2013
243c217
Merge pull request #9 from feiyunruyue/master
Jan 17, 2013
7a2bd70
nits whitespace
jbenet Jan 27, 2013
eb46e8d
use webrtc.io-client directly (symlink was broken)
jbenet Jan 27, 2013
5e65ada
DataChannel support (with fallback)
jbenet Jan 27, 2013
af0231f
stylefix - removed commas ending hash
jbenet Jan 28, 2013
aa38365
Merge pull request #11 from jbenet/master
sarenji Jan 29, 2013
b1aaef0
Connect WebSocket relative to window.location
Feb 6, 2013
66bc37e
Updated dependencies from express 2.5.1 to express 3.1.0
Feb 6, 2013
2c4fd93
Small mistake: removed duplicate of 'server ='
Feb 6, 2013
dd775f0
Merge pull request #12 from danielkutik/master
sarenji Feb 6, 2013
15a7472
variable should be declared
Feb 7, 2013
ca6e5ba
update demo link
benbrittain Feb 9, 2013
839208e
put in actuall link
benbrittain Feb 9, 2013
5864d2b
Merge pull request #13 from danielkutik/master
sarenji Feb 11, 2013
654f9e2
fixed a url fragment issue with web socket url on page load for room …
mattnull Feb 18, 2013
8ef0dce
Merge pull request #14 from mattnull/master
sarenji Feb 18, 2013
7c6f3dd
new demo added and link to the demo page is now correct
Feb 21, 2013
5b7c8a9
remove old version
Feb 21, 2013
f195d17
fix in the readme setup instructions
Feb 21, 2013
1967058
remove google analytics
Feb 22, 2013
80bc181
declared
danielkutik Mar 3, 2013
fef6185
Removed unused variable
danielkutik Mar 3, 2013
8502bf8
Server listen port can now be defined in environment variables (usefu…
danielkutik Mar 3, 2013
4d3492f
Merge pull request #18 from danielkutik/master
sarenji Mar 4, 2013
cf3214c
default port now 8080
Mar 4, 2013
2e596b2
fix the link text to
Mar 4, 2013
001fe6b
Updated webrtc.io.js
danielkutik Mar 6, 2013
8bd941d
Merge pull request #19 from danielkutik/master
dennismartensson Mar 6, 2013
e9b8313
now firefox to firefox works. It looks like there is a conection betw…
Mar 17, 2013
6b0023f
fix the problems in the last build
Mar 17, 2013
e40f50e
sorry did miss some of them
Mar 17, 2013
79b1a15
add toogle to message and made the video of you smaller
dennismartensson Mar 22, 2013
cab9299
Modified website layout and disabled video audio by default to preven…
ajbogh Mar 26, 2014
e78cadc
Fixed merge conflicts.
ajbogh Mar 26, 2014
ee25283
Added a Join Room button instead of the Create Room button and create…
ajbogh Mar 31, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules
lib-cov
*.seed
*.log
Expand All @@ -13,5 +12,5 @@ pids
logs
results

npm-debug.log

node_modules
npm-debug.log
90 changes: 29 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,80 +1,48 @@
# webRTC.io
### [demo](http://webrtc.dennis.is/)
An abstraction layer for webRTC. Aim is to simplify the HTML5 web standard webRTC in a similar manner to socket.io w/ websockets. This project is still in an infantile stage, please send feature requests (or pulls!) to us as well as bug reports.
#webrtc.io-demo
==============

## What is webRTC?
webRTC is a new webstandard being developed for peer-to-peer communication on the web. This means that browsers will be able to send information, without sending information through the server. Server side this will reduce load dramatically.
You can have a look at the [demo](http://webrtc.dennis.is/)

Currently the webRTC standard is very focused on the video & audio aspects of the project. In the future (hopefully near future!) they will begin implementing the data channel, which will allow arbitrary data to be sent peer-to-peer. For now the webRTC team is focused on stabalizing and optimizing the video and audio channels.
##Instructions on how to setup the demo:

Unfortunately, a server (or two) will still be required for two reasons, The media for the page must be initially supplied, and the server, in conjunction with a [STUN server](http://en.wikipedia.org/wiki/STUN) (abstracted away by the webRTC.io library), is required to synchronize the connections.
Run in your terminal

## Browser Support
webRTC is supported in very few browsers. We recommend either chrome from either the dev channel or the canary release.
After installation, go to [About://flags](chrome://flags/). Enable
```bash
git clone [email protected]:webRTC/webrtc.io-demo.git
```
Enable Media Source API on <video> elements. (this may be unnecessary)
Enable MediaStream (this may be unnecessary)
Enable PeerConnection
```

## Demo
This is a multi-person chat room demo written using our webRTC.io library. [Example Site](http://webrtc.dennis.is/) & [Repository](http://www.github.com/webRTC/webrtc.io-demo/) (browser support section still applies!)

## Installation
```bash
npm install webrtc.io
```bash
cd webrtc.io-demo
```
for absurdly detailed instruction on setting up the demo, go to the demo repo.

To run the server in debug mode, append '-debug' to the node command

## Example code

### Client

```html
<video id="local" autoplay="autoplay"></video>
<video id="remote" autoplay="autoplay"></video>

<script src="/webrtc.io.js"></script>
<script>
```bash
npm install
```

// note: make sure hostname available to all connecting clients
// (ie. probably not `localhost`)
rtc.connect('ws://yourserveraddress:8001');
```bash
cd site
```

rtc.createStream({"video": true, "audio":false}, function(stream){
// get local stream for manipulation
rtc.attachStream(stream, 'local');
});
```bash
node server.js
```

rtc.on('add remote stream', function(stream){
// show the remote video
rtc.attachStream(stream, 'remote');
});
In a version of Chrome that have webRTC support.

// more rtc callbacks are available
</script>
```
go to [localhost:8080](http://localhost:8080)

### Server
click allow to see your camera

```javascript
var webRTC = require('webrtc.io').listen(8001);
//then a bunch of callbacks are available
```
go to [localhost:8080](http://localhost:8080)

## Stumped?
```
#webrtc.io on freenode
```
click allow to see your camera and the connection will be made between your to open windows.

### License
Copyright (C) 2012 [Ben Brittain](https://github.com/cavedweller), [Dennis Mårtensson](https://github.com/dennismartensson), [David Peter](https://github.com/sarenji)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
##For instructions on how to start developing with webRTC.io

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
go to [https://github.com/webRTC/webRTC.io](https://github.com/webRTC/webRTC.io) and read the instructions.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Developed by:
[@dennismatensson](https://github.com/dennismartensson)
[@cavedweller](https://github.com/cavedweller)
[@sarenji](https://github.com/sarenji)
4 changes: 3 additions & 1 deletion lib/webrtc.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ function attachEvents(manager) {
}
// we are leaved the room so lets notify about that
rtc.fire('room_leave', room, socket.id);

//check if the room has any existing users and remove it if it doesn't


// call the disconnect callback
rtc.fire('disconnect', rtc);
Expand All @@ -127,7 +130,6 @@ function attachEvents(manager) {
// manages the built-in room functionality
rtc.on('join_room', function(data, socket) {
iolog('join_room');

var connectionsId = [];
var roomList = rtc.rooms[data.room] || [];

Expand Down
46 changes: 30 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
{
"name": "webrtc.io",
"version": "0.0.4",
"description": "Abstraction for webRTC.",
"main": "index.js",
"repository": {
"type": "git",
"url": "git://github.com/cavedweller/webRTC.io.git"
"name": "MultiWebRTC",
"description": "Example of multi user webrtc",
"version": "0.0.2-1",
"engines": {
"node": ">= 0.6.0"
},
"dependencies": {
"ws": ">= 0.0.0"
"webrtc.io": "latest",
"webrtc.io-client": "latest",
"express": "3.1.0",
"ws": "latest"
},
"subdomain": "MultiWebRTC",
"scripts": {
"start": "example/server.js"
},
"keywords": [
"webrtc"
],
"author": "Ben Brittain",
"contributors": [
{ "name": "Ben Brittain", "email": "[email protected]" }
, { "name": "Dennis Mårtensson", "email": "[email protected]" }
, { "name": "David Peter", "email": "[email protected]" }
],
"license": "MIT"
{
"name": "Ben Brittain",
"email": "[email protected]"
},
{
"name": "Dennis Mårtensson",
"email": "[email protected]"
},
{
"name": "David Peter",
"email": "[email protected]"
},
{
"name": "Allan Bogh",
"email": "[email protected]"
}
]
}
Binary file added site/fullscrean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions site/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<html>
<head>
<title>Example webrtc.io</title>
<link type="text/css" href="/style.css" rel="stylesheet"></link>

<script src="/webrtc.io.js"></script>
</head>
<body onload="init()">

<div id="sidebar">
<div class="buttonBox">
<div id="fullscreen" class="button">Enter Full Screen</div>
<div id="joinRoom" class="button">Join Room</div>
</div>
<video id="you" class="flip" autoplay></video>
<div id="chatbox">
<!--<div id="hideShowMessages" class="button">toggle chat</div>-->
<div id="messages">
</div>
<input id="chatinput" type="text" placeholder="Message:"/>
</div>
</div>

<div id="videos" class="clearfix"></div>

<div id="roomList" class="hide">
<h1 class="title">Room List<span class="closeButton">X</span></h1>
<div><label>Room name: <input type="text" id="roomName" name="roomName" /></label><div id="createRoom" class="button">Join Room</div></div>
<div id="roomListCont"></div>
</div>

<script src="/script.js"></script>
</body>
</html>
Loading