Skip to content

Commit

Permalink
Added: rtcmulticonnection-v3@3.2.82
Browse files Browse the repository at this point in the history
  • Loading branch information
muaz-khan committed Jan 13, 2016
1 parent 89ebaf6 commit 64a0f99
Show file tree
Hide file tree
Showing 36 changed files with 7,213 additions and 71 deletions.
49 changes: 49 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<a href="/~https://github.com/muaz-khan/RTCMultiConnection"><img src="https://i.imgur.com/MFfRBSM.png" /></a>

## RTCMultiConnection

> A WebRTC JavaScript Library
# Contributors

1. [Muaz Khan](/~https://github.com/muaz-khan)
2. [Alexey Kucherenko](/~https://github.com/killmenot)
3. [Yuri](/~https://github.com/Yuripetusko)
4. [Dmitry](/~https://github.com/Reptoh)
5. +Your Name

# Rules to Contribute

Download TAR which is having all the codes including `grunt` files. You don't need to install anything.

```
# or MOST preferred one
mkdir RTCMultiConnection-v3.0 && cd RTCMultiConnection-v3.0
wget http://dl.webrtc-experiment.com/rtcmulticonnection-v3.tar.gz
tar -zxvf rtcmulticonnection-v3.tar.gz
ls -a
```

* [rtcmulticonnection-v3.tar.gz](http://dl.webrtc-experiment.com/rtcmulticonnection-v3.tar.gz)

Or manually install via git/NPM:

```
git clone --depth=50 --branch=master git://github.com/muaz-khan/RTCMultiConnection.git muaz-khan/RTCMultiConnection
# install all dependencies
npm install
# install grunt for code style verifications
npm install grunt-cli
npm install grunt
# verify your changes
npm test # or "grunt"
# Success? Make a pull request!
```

## License

[RTCMultiConnection](/~https://github.com/muaz-khan/RTCMultiConnection) is released under [MIT licence](/~https://github.com/muaz-khan/RTCMultiConnection/blob/master/LICENSE.md) . Copyright (c) [Muaz Khan](http://www.MuazKhan.com/).
17 changes: 15 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,23 @@ module.exports = function(grunt) {
},
my_target: {
files: {
'RTCMultiConnection.min.js': ['RTCMultiConnection.js']
'RTCMultiConnection.min.js': ['RTCMultiConnection.js'],
'dist/rmc3.min.js': ['RTCMultiConnection.js'],
'dist/rmc3.fbr.min.js': ['dev/FileBufferReader.js'],
}
}
},
copy: {
main: {
options: {
flatten: true
},
files: {
'dist/rmc3.js': ['RTCMultiConnection.js'],
'dist/rmc3.fbr.js': ['dev/FileBufferReader.js'],
},
},
},
jsbeautifier: {
files: ['RTCMultiConnection.js', 'dev/*.js', 'Gruntfile.js', 'Signaling-Server.js', 'server.js'],
options: {
Expand Down Expand Up @@ -133,5 +146,5 @@ module.exports = function(grunt) {

// set default tasks to run when grunt is called without parameters
// http://gruntjs.com/api/grunt.task
grunt.registerTask('default', ['concat', 'replace', 'jsbeautifier', 'uglify', 'clean']);
grunt.registerTask('default', ['concat', 'replace', 'jsbeautifier', 'uglify', 'clean', 'copy']);
};
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,36 @@ Now open: `https://localhost:9001/`
nohup nodejs server.js > /dev/null 2>&1 &
```

## Link Single File
## Link Script Files

```html
<script src="/RTCMultiConnection.js"></script>
All files from `/dist` directory are available on CDN: `https://cdn.webrtc-experiment.com:443/`

<!-- or minified file -->
```html
<script src="/RTCMultiConnection.min.js"></script>

<!-- or -->
<script src="/dist/rmc3.min.js"></script>

<!-- CDN non-minified or minified -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.min.js"></script>

<!-- or specific version -->
<script src="/~https://github.com/muaz-khan/RTCMultiConnection/releases/download/3.2.82/rmc3.min.js"></script>
```

If you're sharing files, you also need to link:

```html
<script src="/dev/FileBufferReader.js"></script>

<!-- or CDN -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.fbr.min.js"></script>

<!-- or specific version -->
<script src="/~https://github.com/muaz-khan/RTCMultiConnection/releases/download/3.2.82/rmc3.fbr.min.js"></script>
```

You can link multiple files from "dev" directory.
> You can link multiple files from `dev` directory. Order doesn't matters.
## Set different socket URL

Expand Down
44 changes: 34 additions & 10 deletions RTCMultiConnection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Last time updated at Monday, January 11th, 2016, 4:20:40 PM
// Last time updated at Wednesday, January 13th, 2016, 7:18:18 PM

// ______________________________
// RTCMultiConnection-v3.0 (Beta)
Expand Down Expand Up @@ -263,7 +263,7 @@
};

connection.rejoin = function(connectionDescription) {
if (connection.isInitiator) {
if (connection.isInitiator || !connectionDescription || !Object.keys(connectionDescription).length) {
return;
}

Expand Down Expand Up @@ -390,7 +390,7 @@

if (session.audio || session.video || session.screen) {
if (session.screen) {
getScreenConstraints(function(error, screen_constraints) {
connection.getScreenConstraints(function(error, screen_constraints) {
if (error) {
throw error;
}
Expand Down Expand Up @@ -683,7 +683,7 @@

if (!session.audio || session.video || session.screen) {
if (session.screen) {
getScreenConstraints(function(error, screen_constraints) {
connection.getScreenConstraints(function(error, screen_constraints) {
if (error) {
return alert(error);
}
Expand Down Expand Up @@ -819,7 +819,7 @@

if (!session.audio || session.video || session.screen) {
if (session.screen) {
getScreenConstraints(function(error, screen_constraints) {
connection.getScreenConstraints(function(error, screen_constraints) {
if (error) {
return alert(error);
}
Expand Down Expand Up @@ -1215,7 +1215,25 @@
if (connection.enableLogs) {
console.info('ReConnecting with', event.userid, '...');
}
};

connection.beforeAddingStream = function(stream) {
return stream;
};

connection.beforeRemovingStream = function(stream) {
return stream;
};

if (typeof isChromeExtensionAvailable !== 'undefined') {
connection.checkIfChromeExtensionAvailable = isChromeExtensionAvailable;
}

if (typeof isFirefoxExtensionAvailable !== 'undefined') {
connection.checkIfChromeExtensionAvailable = isFirefoxExtensionAvailable;
}

connection.getScreenConstraints = getScreenConstraints;
}

function SocketConnection(connection, connectCallback) {
Expand Down Expand Up @@ -1681,7 +1699,9 @@
self.disconnectWith(remoteUserId);
}
},
processSdp: connection.processSdp
processSdp: connection.processSdp,
beforeAddingStream: connection.beforeAddingStream,
beforeRemovingStream: connection.beforeRemovingStream
};
};

Expand All @@ -1701,14 +1721,14 @@
return;
}

userPreferences = connection.setUserPreferences(userPreferences);
userPreferences = connection.setUserPreferences(userPreferences, remoteUserId);

var localConfig = this.getLocalConfig(null, remoteUserId, userPreferences);
connection.peers[remoteUserId] = new PeerInitiator(localConfig);
};

this.createAnsweringPeer = function(remoteSdp, remoteUserId, userPreferences) {
userPreferences = connection.setUserPreferences(userPreferences || {});
userPreferences = connection.setUserPreferences(userPreferences || {}, remoteUserId);

var localConfig = this.getLocalConfig(remoteSdp, remoteUserId, userPreferences);
connection.peers[remoteUserId] = new PeerInitiator(localConfig);
Expand Down Expand Up @@ -2492,7 +2512,8 @@

config.removeStreams.forEach(function(streamToRemove, index) {
if (stream === streamToRemove) {
if (!!peer.removeStream) {
stream = config.beforeRemovingStream(stream);
if (stream && !!peer.removeStream) {
peer.removeStream(stream);
}

Expand Down Expand Up @@ -2529,7 +2550,10 @@
return;
}

peer.addStream(localStream);
localStream = config.beforeAddingStream(localStream);
if (localStream) {
peer.addStream(localStream);
}
});

peer.oniceconnectionstatechange = peer.onsignalingstatechange = function() {
Expand Down
10 changes: 5 additions & 5 deletions RTCMultiConnection.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion demos/Audio+ScreenSharing.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ <h1>Audio + ScreenSharing using RTCMultiConnection-v3.0</h1>
<div id="videos-container"></div>
</section>

<script src="/RTCMultiConnection.min.js"></script>
<!-- <script src="/RTCMultiConnection.min.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.min.js"></script>

<!-- socket.io for signaling -->
<script src="/socket.io/socket.io.js"></script>
Expand Down
7 changes: 5 additions & 2 deletions demos/Audio+Video+TextChat+FileSharing.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ <h1>Audio+Video+TextChat+FileSharing using RTCMultiConnection-v3.0</h1>
<div id="videos-container"></div>
</section>

<script src="/RTCMultiConnection.min.js"></script>
<script src="/dev/FileBufferReader.js"></script>
<!-- <script src="/RTCMultiConnection.min.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.min.js"></script>

<!-- <script src="/dev/FileBufferReader.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.fbr.min.js"></script>

<!-- socket.io for signaling -->
<script src="/socket.io/socket.io.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion demos/Audio-Conferencing.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ <h1>Audio Conferencing using RTCMultiConnection-v3.0</h1>
<div id="videos-container"></div>
</section>

<script src="/RTCMultiConnection.min.js"></script>
<!-- <script src="/RTCMultiConnection.min.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.min.js"></script>

<!-- socket.io for signaling -->
<script src="/socket.io/socket.io.js"></script>
Expand Down
7 changes: 5 additions & 2 deletions demos/Disconnect+Rejoin.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ <h1>Disconnect+Rejoin using RTCMultiConnection-v3.0</h1>
<div id="videos-container"></div>
</section>

<script src="/RTCMultiConnection.min.js"></script>
<script src="/dev/FileBufferReader.js"></script>
<!-- <script src="/RTCMultiConnection.min.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.min.js"></script>

<!-- <script src="/dev/FileBufferReader.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.fbr.min.js"></script>

<!-- socket.io for signaling -->
<script src="/socket.io/socket.io.js"></script>
Expand Down
8 changes: 6 additions & 2 deletions demos/Files-Scalable-Broadcast.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,12 @@ <h1><a href="/~https://github.com/muaz-khan/WebRTC-Scalable-Broadcast">WebRTC Scal
</blockquote>

<script src="/socket.io/socket.io.js"></script>
<script src="/RTCMultiConnection.min.js"></script>
<script src="/dev/FileBufferReader.js"></script>
<!-- <script src="/RTCMultiConnection.min.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.min.js"></script>

<!-- <script src="/dev/FileBufferReader.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.fbr.min.js"></script>

<script>
var connection = new RTCMultiConnection();
connection.enableScalableBroadcast = true;
Expand Down
7 changes: 5 additions & 2 deletions demos/Firebase-Demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ <h1>Firebase Video Conferencing Demo using RTCMultiConnection-v3.0</h1>
<div id="videos-container"></div>
</section>

<script src="../RTCMultiConnection.min.js"></script>
<script src="../dev/FileBufferReader.js"></script>
<!-- <script src="/RTCMultiConnection.min.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.min.js"></script>

<!-- <script src="/dev/FileBufferReader.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.fbr.min.js"></script>

<!-- socket.io for signaling
<script src="/socket.io/socket.io.js"></script>
Expand Down
7 changes: 5 additions & 2 deletions demos/Password-Protected-Rooms.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,11 @@ <h1>Password+Protected+Rooms using RTCMultiConnection-v3.0</h1>
<div id="videos-container"></div>
</section>

<script src="/RTCMultiConnection.min.js"></script>
<script src="/dev/FileBufferReader.js"></script>
<!-- <script src="/RTCMultiConnection.min.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.min.js"></script>

<!-- <script src="/dev/FileBufferReader.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.fbr.min.js"></script>

<!-- socket.io for signaling -->
<script src="/socket.io/socket.io.js"></script>
Expand Down
7 changes: 5 additions & 2 deletions demos/PubNub-Demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ <h1>PubNub Video Conferencing Demo using RTCMultiConnection-v3.0</h1>
<div id="videos-container"></div>
</section>

<script src="../RTCMultiConnection.min.js"></script>
<script src="../dev/FileBufferReader.js"></script>
<!-- <script src="/RTCMultiConnection.min.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.min.js"></script>

<!-- <script src="/dev/FileBufferReader.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.fbr.min.js"></script>

<!-- socket.io for signaling
<script src="/socket.io/socket.io.js"></script>
Expand Down
7 changes: 7 additions & 0 deletions demos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
You can test all demos LIVE here:

* https://rtcmulticonnection.herokuapp.com/

Source codes are available here:

* /~https://github.com/muaz-khan/RTCMultiConnection/tree/master/demos
7 changes: 5 additions & 2 deletions demos/TextChat+FileSharing.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ <h1>TextChat+FileSharing using RTCMultiConnection-v3.0</h1>
</div>
</section>

<script src="/RTCMultiConnection.min.js"></script>
<script src="/dev/FileBufferReader.js"></script>
<!-- <script src="/RTCMultiConnection.min.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.min.js"></script>

<!-- <script src="/dev/FileBufferReader.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.fbr.min.js"></script>

<!-- socket.io for signaling -->
<script src="/socket.io/socket.io.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion demos/Video-Conferencing.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ <h1>Video Conferencing using RTCMultiConnection-v3.0</h1>
<div id="videos-container"></div>
</section>

<script src="/RTCMultiConnection.min.js"></script>
<!-- <script src="/RTCMultiConnection.min.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.min.js"></script>

<!-- socket.io for signaling -->
<script src="/socket.io/socket.io.js"></script>
Expand Down
6 changes: 2 additions & 4 deletions demos/applyConstraints.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ <h1>MediaStreamTrack.applyConstraints demo using RTCMultiConnection-v3.0</h1>
<div id="videos-container"></div>
</section>

<script src="/RTCMultiConnection.min.js"></script>
<script src="/dev/getScreenId.js"></script>
<!-- <script src="/RTCMultiConnection.min.js"></script> -->
<script src="https://cdn.webrtc-experiment.com:443/rmc3.min.js"></script>

<!-- socket.io for signaling -->
<script src="/socket.io/socket.io.js"></script>
Expand Down Expand Up @@ -109,8 +109,6 @@ <h1>MediaStreamTrack.applyConstraints demo using RTCMultiConnection-v3.0</h1>

document.getElementById('room-id').value = connection.token();

connection.enableFileSharing = true; // by default, it is "false".

connection.session = {
audio: true,
video: true
Expand Down
Loading

0 comments on commit 64a0f99

Please sign in to comment.