Skip to content

Commit 6239acd

Browse files
committed
1 parent 83cd060 commit 6239acd

File tree

396 files changed

+32205
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

396 files changed

+32205
-175
lines changed

README.md

+100-62
Original file line numberDiff line numberDiff line change
@@ -8,67 +8,42 @@ These demos/experiments are entirely client-side; i.e. no server installation ne
88

99
----
1010

11-
#### Browser Support
11+
### Libraries
1212

13-
[WebRTC Experiments](https://webrtc-experiment.appspot.com) works fine on following web-browsers:
14-
15-
| Browser | Support |
16-
| ------------- |-------------|
17-
| Firefox | [Stable](http://www.mozilla.org/en-US/firefox/new/) / [Aurora](http://www.mozilla.org/en-US/firefox/aurora/) / [Nightly](http://nightly.mozilla.org/) |
18-
| Google Chrome | [Stable](https://www.google.com/intl/en_uk/chrome/browser/) / [Canary](https://www.google.com/intl/en/chrome/browser/canary.html) / [Beta](https://www.google.com/intl/en/chrome/browser/beta.html) / [Dev](https://www.google.com/intl/en/chrome/browser/index.html?extra=devchannel#eula) |
19-
| Internet Explorer / IE | [Chrome Frame](http://www.google.com/chromeframe) |
20-
| Android | [Chrome Beta](https://play.google.com/store/apps/details?id=com.chrome.beta&hl=en) |
13+
1. [RTCMultiConnection.js](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/RTCMultiConnection) — A JavaScript library for streams renegotiation and sharing; multi-session establishment and much more.
14+
2. [DataChannel.js](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/DataChannel) — A JavaScript library for data/file/text sharing!
15+
3. [RecordRTC.js](https://webrtc-experiment.appspot.com/RecordRTC/) — A library to record audio/video streams / [Demo](https://webrtc-experiment.appspot.com/RecordRTC/)
16+
4. [RTCall.js](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/RTCall) — A library for Browser-to-Browser audio-only calling / [Demo](https://webrtc-experiment.appspot.com/RTCall/)
2117

2218
----
2319

24-
### Simplest Libraries Ever!
20+
#### WebRTC Signaling Gateways
2521

26-
1. [DataChannel.js](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/DataChannel) — A JavaScript library for data/file/text sharing!
27-
2. [RTCMultiConnection.js](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/RTCMultiConnection) — A JavaScript library for streams renegotiation and sharing; multi-session establishment and much more.
28-
3. [RecordRTC.js](https://webrtc-experiment.appspot.com/RecordRTC/) — A library to record audio/video streams
29-
4. [RTCall.js](https://webrtc-experiment.appspot.com/RTCall/) — A library for Browser-to-Browser audio-only calling
22+
Following signaling gateways can work with each and every [WebRTC Experiment](https://webrtc-experiment.appspot.com/)!
3023

31-
Scroll to bottom of the page to see how to use these four unique libraries!
24+
1. [WebSocket over Node.js](https://github.com/muaz-khan/WebRTC-Experiment/blob/master/websocket-over-nodejs)[Demo](http://websocket-over-nodejs.jit.su/)
25+
2. [Socket.io over Node.js](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/socketio-over-nodejs)[Demo](http://webrtc-signaling.jit.su/)
3226

3327
----
3428

35-
1. [Pre-recorded media streaming](https://webrtc-experiment.appspot.com/Pre-recorded-Media-Streaming/) — Most demanded and useful feature!
36-
2. [Socket.io over Node.js](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/socketio-over-nodejs) — Copy/Paste/Deploy and you're done!
29+
1. [RecordRTC: WebRTC audio/video recording](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/RecordRTC) / [Demo](https://webrtc-experiment.appspot.com/RecordRTC/)
30+
2. [Pre-recorded media streaming](https://webrtc-experiment.appspot.com/Pre-recorded-Media-Streaming/)
31+
3. [WebRTC one-way video broadcasting](https://webrtc-experiment.appspot.com/webrtc-broadcasting/)
3732

3833
----
3934

40-
#### Many-to-Many style of WebRTC Experiments
41-
42-
1. [Group video sharing / video-conferencing](https://webrtc-experiment.appspot.com/video-conferencing/)
43-
2. [Group file sharing](https://webrtc-experiment.appspot.com/file-hangout/)
44-
3. [Group text chat](https://webrtc-experiment.appspot.com/chat-hangout/)
45-
46-
----
47-
48-
### One-way video broadcasting
49-
50-
1. [WebRTC one-way video broadcasting](https://webrtc-experiment.appspot.com/webrtc-broadcasting/)
51-
52-
----
53-
54-
#### One-to-Many style of WebRTC Experiments
55-
56-
1. [Video broadcasting](https://webrtc-experiment.appspot.com/broadcast/)
57-
2. [Audio broadcasting](https://webrtc-experiment.appspot.com/audio-broadcast/)
58-
59-
----
60-
61-
#### One-to-One style of WebRTC Experiments
35+
#### [Screen sharing](https://webrtc-experiment.appspot.com/#screen-sharing)
6236

63-
1. [One-to-one WebRTC video chat using WebSocket](https://webrtc-experiment.appspot.com/websocket/)
64-
2. [One-to-one WebRTC video chat using socket.io](https://webrtc-experiment.appspot.com/socket.io/)
37+
1. [Plugin free screen sharing](https://webrtc-experiment.appspot.com/Pluginfree-Screen-Sharing/)
38+
2. [Screen sharing](https://webrtc-experiment.appspot.com/screen-broadcast/)
6539

6640
----
6741

68-
#### [Screen sharing](https://webrtc-experiment.appspot.com/#screen-sharing)
42+
#### Many-to-Many style of WebRTC Experiments
6943

70-
1. [Plugin free screen sharing](https://webrtc-experiment.appspot.com/Pluginfree-Screen-Sharing/)
71-
2. [Screen sharing](https://webrtc-experiment.appspot.com/screen-broadcast/)
44+
1. [Group video sharing / video-conferencing](https://webrtc-experiment.appspot.com/video-conferencing/)
45+
2. [Group file sharing](https://webrtc-experiment.appspot.com/file-hangout/)
46+
3. [Group text chat](https://webrtc-experiment.appspot.com/chat-hangout/)
7247

7348
----
7449

@@ -81,18 +56,6 @@ Scroll to bottom of the page to see how to use these four unique libraries!
8156

8257
----
8358

84-
#### WebRTC Audio/Video Recording
85-
86-
[RecordRTC: WebRTC audio/video recording](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/RecordRTC) / [Demo](https://webrtc-experiment.appspot.com/RecordRTC/)
87-
88-
----
89-
90-
#### Pre-recorded media streaming
91-
92-
[Pre-recorded media streaming](https://webrtc-experiment.appspot.com/Pre-recorded-Media-Streaming/)
93-
94-
----
95-
9659
#### Demos using [DataChannel.js](https://webrtc-experiment.appspot.com/DataChannel.js)
9760

9861
1. [DataChannel basic demo](https://webrtc-experiment.appspot.com/DataChannel/)
@@ -117,6 +80,21 @@ Scroll to bottom of the page to see how to use these four unique libraries!
11780
13. [Customizing Bandwidth](https://webrtc-experiment.appspot.com/RTCMultiConnection/bandwidth/)
11881
14. [RTCMultiConnection-v1.3 testing demo](https://webrtc-experiment.appspot.com/RTCMultiConnection-v1.3/)
11982

83+
84+
----
85+
86+
#### One-to-Many style of WebRTC Experiments
87+
88+
1. [Video broadcasting](https://webrtc-experiment.appspot.com/broadcast/)
89+
2. [Audio broadcasting](https://webrtc-experiment.appspot.com/audio-broadcast/)
90+
91+
----
92+
93+
#### One-to-One style of WebRTC Experiments
94+
95+
1. [One-to-one WebRTC video chat using WebSocket](https://webrtc-experiment.appspot.com/websocket/)
96+
2. [One-to-one WebRTC video chat using socket.io](https://webrtc-experiment.appspot.com/socket.io/)
97+
12098
----
12199

122100
| in-Page / One-Page / Client Side |
@@ -154,9 +132,16 @@ Scroll to bottom of the page to see how to use these four unique libraries!
154132

155133
```javascript
156134
var channel = new DataChannel('channel-name');
135+
157136
channel.onopen = function(e) {};
158137
channel.onmessage = function(e) {};
138+
139+
// share with all participants
159140
channel.send(file || data || 'text');
141+
142+
// Direct messages using user-ids
143+
channel.userid = 'muazkh';
144+
channel.channels['muazkh'].send(file || data || 'text');
160145
```
161146

162147
----
@@ -169,6 +154,14 @@ channel.send(file || data || 'text');
169154

170155
```javascript
171156
var connection = new RTCMultiConnection();
157+
connection.session = {
158+
audio: true,
159+
video: true
160+
};
161+
connection.bandwidth = {
162+
audio: 50,
163+
video: 256
164+
};
172165
connection.onstream = function (e) {
173166
if (e.type === 'local') mainVideo.src = e.blobURL;
174167
if (e.type === 'remote') document.body.appendChild(e.mediaElement);
@@ -178,10 +171,7 @@ connection.onstream = function (e) {
178171
connection.connect('session-id');
179172

180173
// to create/open a new session
181-
// it should be called "only-once" by the session-initiator
182-
[button-init-session].onclick = function() {
183-
connection.open('session-id');
184-
};
174+
connection.open('session-id');
185175
```
186176

187177
----
@@ -204,7 +194,40 @@ call.oncustomer = function(customer) {
204194

205195
----
206196

207-
#### Use [your own](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/socketio-over-nodejs) socket.io implementation!
197+
#### Use [WebSocket over Node.js](https://github.com/muaz-khan/WebRTC-Experiment/blob/master/websocket-over-nodejs) for signaling
198+
199+
In `ui.js` files you can find `openSocket` method; or in all libraries; you can find `openSignalingChannel` method.
200+
201+
```javascript
202+
var SIGNALING_SERVER = 'ws://' + document.domain + ':8888/';
203+
openSignalingChannel: function(config) {
204+
config.channel = config.channel || 'default-channel';
205+
var websocket = new WebSocket(SIGNALING_SERVER);
206+
websocket.channel = config.channel;
207+
websocket.onopen = function() {
208+
websocket.push(JSON.stringify({
209+
open: true,
210+
channel: config.channel
211+
}));
212+
if (config.callback)
213+
config.callback(websocket);
214+
};
215+
websocket.onmessage = function(event) {
216+
config.onmessage(JSON.parse(event.data));
217+
};
218+
websocket.push = websocket.send;
219+
websocket.send = function(data) {
220+
websocket.push(JSON.stringify({
221+
data: data,
222+
channel: config.channel
223+
}));
224+
};
225+
}
226+
```
227+
228+
----
229+
230+
#### Use [Socket.io over Node.js](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/socketio-over-nodejs) for signaling!
208231

209232
```javascript
210233
// openSignalingChannel or openSocket!
@@ -238,7 +261,9 @@ openSignalingChannel: function(config) {
238261

239262
For a ready-made socket.io over node.js implementation; [visit this link](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/socketio-over-nodejs).
240263

241-
#### Use `firebase` for testing purpose!
264+
----
265+
266+
#### Use `firebase` for signaling!
242267

243268
Remember, You must link [firebase.js](https://cdn.firebase.com/v0/firebase.js) file before using below code:
244269

@@ -304,6 +329,19 @@ recorder.stopAudio(function(recordedFileURL) {
304329

305330
----
306331

332+
#### Browser Support
333+
334+
[WebRTC Experiments](https://webrtc-experiment.appspot.com) works fine on following web-browsers:
335+
336+
| Browser | Support |
337+
| ------------- |-------------|
338+
| Firefox | [Stable](http://www.mozilla.org/en-US/firefox/new/) / [Aurora](http://www.mozilla.org/en-US/firefox/aurora/) / [Nightly](http://nightly.mozilla.org/) |
339+
| Google Chrome | [Stable](https://www.google.com/intl/en_uk/chrome/browser/) / [Canary](https://www.google.com/intl/en/chrome/browser/canary.html) / [Beta](https://www.google.com/intl/en/chrome/browser/beta.html) / [Dev](https://www.google.com/intl/en/chrome/browser/index.html?extra=devchannel#eula) |
340+
| Internet Explorer / IE | [Chrome Frame](http://www.google.com/chromeframe) |
341+
| Android | [Chrome Beta](https://play.google.com/store/apps/details?id=com.chrome.beta&hl=en) |
342+
343+
----
344+
307345
#### License
308346

309347
[WebRTC Experiments](https://webrtc-experiment.appspot.com/) are released under [MIT licence](https://webrtc-experiment.appspot.com/licence/) . Copyright (c) 2013 [Muaz Khan](https://plus.google.com/100325991024054712503).

RTCMultiConnection/RTCMultiConnection-v1.3.js

-1
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,6 @@
749749
});
750750
});
751751
} else {
752-
log('no way, it is too bad!');
753752
// otherwise; suggest other user to play role of renegotiator
754753
socket.send({
755754
userid: self.userid,

socket.io/index.html

+6-18
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
<article>
175175
<a href="https://webrtc-experiment.appspot.com/" style="border-bottom: 1px solid #2844FA; font-size: 1.2em; position: absolute; text-decoration: none;right:0;top:0;">↑ WEBRTC EXPERIMENTS</a>
176176

177-
<h1>Using socket.io for signaling</h1>
177+
<h1>Using socket.io for signaling / <a href="https://github.com/muaz-khan/WebRTC-Experiment/tree/master/socket.io" target="_blank">Source Code on Github</a></h1>
178178
<p>
179179
<span>Copyright © 2013</span>
180180
<a href="https://github.com/muaz-khan" target="_blank">Muaz Khan</a><span>&lt;</span><a href="http://twitter.com/muazkh" target="_blank">@muazkh</a><span>&gt;.</span>
@@ -212,27 +212,15 @@ <h2>
212212
<script src="https://webrtc-experiment.appspot.com/RTCPeerConnection-v1.5.js"></script>
213213
<script src="https://webrtc-experiment.appspot.com/socket.io/rtclib.js"> </script>
214214
<script src="https://webrtc-experiment.appspot.com/socket.io/ui.js"></script>
215-
216-
<br />
217-
<br />
218-
219-
<h2 style="float:right;"><a href="https://github.com/muaz-khan/WebRTC-Experiment/tree/master/socket.io" target="_blank">Source Code on Github</a></h2>
215+
<p>WebRTC one-to-one video sharing experiment where socket.io is used for signaling.</p>
216+
</article>
217+
<article>
218+
<h2>Use <a href="https://github.com/muaz-khan/WebRTC-Experiment/tree/master/socketio-over-nodejs" target="_blank">Socket.io over Node.js</a> for signaling! / <a href="http://webrtc-signaling.jit.su/" target="_blank">Demo</a></h2>
220219

221-
<br />
222-
<br />
223-
224-
WebRTC one-to-one video sharing experiment where socket.io is used for signaling.
225-
<br />
226-
<br />
227-
228-
<h2>
229-
Interested to write your own <span style="color:red;">socket.io over node.js</span> application for signaling? <a href="https://github.com/muaz-khan/WebRTC-Experiment/tree/master/socketio-over-nodejs" target="_blank" title="Copy, paste and you're done!">Try this!</a>
230-
</h2>
231220
<br />
232221
<br />
233222

234-
You can use <a href="https://github.com/muaz-khan/WebRTC-Experiment/tree/master/RTCMultiConnection" target="_blank">RTCMultiConnection.js</a> for audio/video/screen conferencing/broadcasting, multi-sessions on the same page, text chat and file sharing!
235-
223+
You can use <a href="https://github.com/muaz-khan/WebRTC-Experiment/tree/master/RTCMultiConnection" target="_blank">RTCMultiConnection.js</a> library for everything!
236224

237225
<br /><br />
238226
<table style="width: 100%;">

socket.io/ui.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* MIT License: https://webrtc-experiment.appspot.com/licence/ */
1+
// MIT License: https://webrtc-experiment.appspot.com/licence/
2+
// Use Socket.io over Node.js for signaling: https://github.com/muaz-khan/WebRTC-Experiment/tree/master/socketio-over-nodejs
23

34
var config = {
45
openSocket: function (config) {

0 commit comments

Comments
 (0)