Skip to content

Commit

Permalink
(Version 3) Fixed #346 herokuapp-demo fixed as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
muaz-khan committed Mar 7, 2017
1 parent 3d91bd6 commit 56eddfc
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
6 changes: 5 additions & 1 deletion dev/RTCMultiConnection.js
Expand Up @@ -833,7 +833,7 @@

connection.direction = 'many-to-many';

connection.removeStream = function(streamid) {
connection.removeStream = function(streamid, remoteUserId) {
var stream;
connection.attachStreams.forEach(function(localStream) {
if (localStream.id === streamid) {
Expand All @@ -847,6 +847,10 @@
}

connection.peers.getAllParticipants().forEach(function(participant) {
if (remoteUserId && participant !== remoteUserId) {
return;
}

var user = connection.peers[participant];
try {
user.peer.removeStream(stream);
Expand Down
8 changes: 8 additions & 0 deletions dev/RTCPeerConnection.js
Expand Up @@ -64,6 +64,14 @@ function PeerInitiator(config) {
this.channels = config.channels || [];
this.connectionDescription = config.connectionDescription;

this.addStream = function(session) {
connection.addStream(session, this.userid);
};

this.removeStream = function(streamid) {
connection.removeStream(streamid, this.userid);
};

var self = this;

if (config.remoteSdp) {
Expand Down
16 changes: 14 additions & 2 deletions dist/RTCMultiConnection.js
@@ -1,4 +1,4 @@
// Last time updated: 2017-02-28 3:01:32 AM UTC
// Last time updated: 2017-03-07 11:34:20 AM UTC

// _________________________
// RTCMultiConnection v3.4.3
Expand Down Expand Up @@ -2361,6 +2361,14 @@ window.RTCMultiConnection = function(roomid, forceOptions) {
this.channels = config.channels || [];
this.connectionDescription = config.connectionDescription;

this.addStream = function(session) {
connection.addStream(session, this.userid);
};

this.removeStream = function(streamid) {
connection.removeStream(streamid, this.userid);
};

var self = this;

if (config.remoteSdp) {
Expand Down Expand Up @@ -4776,7 +4784,7 @@ window.RTCMultiConnection = function(roomid, forceOptions) {

connection.direction = 'many-to-many';

connection.removeStream = function(streamid) {
connection.removeStream = function(streamid, remoteUserId) {
var stream;
connection.attachStreams.forEach(function(localStream) {
if (localStream.id === streamid) {
Expand All @@ -4790,6 +4798,10 @@ window.RTCMultiConnection = function(roomid, forceOptions) {
}

connection.peers.getAllParticipants().forEach(function(participant) {
if (remoteUserId && participant !== remoteUserId) {
return;
}

var user = connection.peers[participant];
try {
user.peer.removeStream(stream);
Expand Down
10 changes: 5 additions & 5 deletions dist/RTCMultiConnection.min.js

Large diffs are not rendered by default.

0 comments on commit 56eddfc

Please sign in to comment.