Skip to content

Commit c3df3b8

Browse files
committed
RTCMultiConnection-v1.3 is ready for tests!
You can test streams renegotiation features; mute/unmute; bandwidth; direct messages; and much more. To read what’s new in v1.3 and what you can do: https://github.com/muaz-khan/WebRTC-Experiment/tree/master/RTCMultiConnection 1. You can send direct messages 2. You can renegotiate streams among all users 3. You can renegotiate streams directly between two unique users 4. You can mute/unmute any stream 5. You can set bandwidth for audio/video streams The only issue in the moment is “screen-sharing in one-way” is not working. This issue occurs only with renegotiated streams. When someone Mute or UnMute stream; currently unable to alert him about the action; so he can show a “poster” in the place of “video” box. It will be fixed in the next commits. An advance demo will be coming soon (in a few days); till that you can try this “simple” demo: https://webrtc-experiment.appspot.com/RTCMultiConnection-v1.3/
1 parent 533ff6c commit c3df3b8

File tree

4 files changed

+1370
-1399
lines changed

4 files changed

+1370
-1399
lines changed

Diff for: README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ These demos/experiments are entirely client-side; i.e. no server installation ne
1010

1111
### Libraries
1212

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/)
13+
1. [RTCMultiConnection.js](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/RTCMultiConnection)[Demos](https://webrtc-experiment.appspot.com/#RTCMultiConnection)
14+
2. [DataChannel.js](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/DataChannel)[Demos](https://webrtc-experiment.appspot.com/#DataChannel)
15+
3. [RecordRTC.js](https://webrtc-experiment.appspot.com/RecordRTC/)[Demo](https://webrtc-experiment.appspot.com/RecordRTC/)
16+
4. [RTCall.js](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/RTCall)[Demo](https://webrtc-experiment.appspot.com/RTCall/)
1717

1818
----
1919

2020
#### WebRTC Signaling Gateways
2121

2222
Following signaling gateways can work with each and every [WebRTC Experiment](https://webrtc-experiment.appspot.com/)!
2323

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/)
24+
1. [Socket.io over Node.js](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/socketio-over-nodejs)[Demo](http://webrtc-signaling.jit.su/)
25+
2. [WebSocket over Node.js](https://github.com/muaz-khan/WebRTC-Experiment/blob/master/websocket-over-nodejs)[Demo](http://websocket-over-nodejs.jit.su/)
2626

2727
----
2828

Diff for: RTCMultiConnection/README.md

-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
`RTCMultiConnection-v1.3` is still under developement; see a [testing demo](https://webrtc-experiment.appspot.com/RTCMultiConnection-v1.3/). You're recommended to try [v1.2](https://github.com/muaz-khan/WebRTC-Experiment/blob/master/RTCMultiConnection/RTCMultiConnection-v1.2-and-earlier.md) until `v1.3` gets ready.
2-
3-
----
4-
51
#### [RTCMultiConnection](https://webrtc-experiment.appspot.com/#RTCMultiConnection): A simple library to handle advance tasks!
62

73
Supports features like
@@ -153,16 +149,6 @@ connection.streams['stream-id'].unmute({
153149

154150
----
155151

156-
#### `removeStream`
157-
158-
```javascript
159-
connection.streams['stream-id'].removeStream();
160-
```
161-
162-
Above line will remove a stream and renegotiate the peer connection.
163-
164-
----
165-
166152
#### Detect users presence
167153

168154
```javascript

Diff for: RTCMultiConnection/RTCMultiConnection-Demos/RTCMultiConnection-v1.3-demo.html

+34-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!DOCTYPE html>
2-
<html lang="en">
2+
<html lang="en">
3+
34
<head>
45
<title>RTCMultiConnection-v1.3.js testing demo! ® Muaz Khan</title>
56
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
@@ -8,18 +9,18 @@
89
<link rel="author" type="text/html" href="https://plus.google.com/100325991024054712503">
910
<meta name="author" content="Muaz Khan">
1011
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
11-
<script>
12+
<script>
1213
var hash = window.location.hash.replace('#', '');
1314
if (!hash.length) {
1415
location.href = location.href + '#' + ((Math.random() * new Date().getTime()).toString(36).toUpperCase().replace(/\./g, '-'));
1516
location.reload();
1617
}
1718
</script>
18-
<script src="/firebase.js"></script>
19+
<script src="/firebase.js"></script>
1920
<script src="/RTCMultiConnection-v1.3.js"></script>
2021
</head>
2122

22-
<body>
23+
<body>
2324
<button id="new-session">Open New Session</button>
2425
<input type="checkbox" id="audio-renegotiation" checked>
2526
<label for="audio-renegotiation">Renegotiate Audio</label>
@@ -28,13 +29,11 @@
2829
<input type="checkbox" id="screen-renegotiation">
2930
<label for="screen-renegotiation">Renegotiate Screen</label>
3031
<input type="checkbox" id="one-way">
31-
<label for="one-way">Is One Way?</label>
32-
<a href="https://webrtc-experiment.appspot.com/">Goto "WebRTC Experiments & Demos" Homepage</a>
32+
<label for="one-way">Is One Way?</label> <a href="https://webrtc-experiment.appspot.com/">Goto "WebRTC Experiments & Demos" Homepage</a>
3333

3434
<div id="local-video-container" class="local-video-container"></div>
3535
<div id="remote-videos-container" class="remote-videos-container"></div>
36-
37-
<h2>How it works?</h2>
36+
<h2>How it works?</h2>
3837

3938
<p>Renegotiation means using pre-created peer connections to add additional streams by renegotiating offer/answer session descriptions.</p>
4039
<p>In this demo; at first time; only data connection is opened. Later on, same peer connections are used to renegotiate audio, video or screen streams.</p>
@@ -93,6 +92,29 @@ <h2>How it works?</h2>
9392
div = document.createElement('div');
9493
div.className = 'video-container';
9594
div.id = e.userid || 'You';
95+
96+
button = document.createElement('button');
97+
button.innerHTML = 'Mute';
98+
button.id = e.streamid;
99+
button.onclick = function () {
100+
button = this;
101+
button.disabled = true;
102+
streamid = button.id;
103+
104+
if (button.innerHTML == 'Mute') {
105+
connection.streams[streamid].mute();
106+
button.innerHTML = 'UnMute';
107+
} else {
108+
connection.streams[streamid].unmute();
109+
button.innerHTML = 'Mute';
110+
}
111+
112+
setTimeout(function () {
113+
button.disabled = false;
114+
}, 1000);
115+
};
116+
div.appendChild(button);
117+
96118
div.appendChild(e.mediaElement);
97119

98120
h2 = document.createElement('h2');
@@ -112,7 +134,9 @@ <h2>How it works?</h2>
112134
-webkit-user-select:none;
113135
font-family:'Segoe UI Light';
114136
}
115-
html{overflow: hidden;}
137+
html {
138+
overflow: hidden;
139+
}
116140
.local-video-container {
117141
border: 2px solid red;
118142
width:40%;
@@ -229,4 +253,5 @@ <h2>How it works?</h2>
229253
}
230254
</script>
231255
</body>
256+
232257
</html>

0 commit comments

Comments
 (0)