|
|
|
|
94
|
};
|
94
|
};
|
95
|
this.peerconnection.onaddstream = function (event) {
|
95
|
this.peerconnection.onaddstream = function (event) {
|
96
|
ob.remoteStream = event.stream;
|
96
|
ob.remoteStream = event.stream;
|
|
|
97
|
+ // search the jid associated with this stream
|
|
|
98
|
+ Object.keys(ob.remotessrc).forEach(function (jid) {
|
|
|
99
|
+ if (ob.remotessrc[jid].join('\r\n').indexOf('mslabel:' + event.stream.id) != -1) {
|
|
|
100
|
+ event.peerjid = jid;
|
|
|
101
|
+ }
|
|
|
102
|
+ });
|
97
|
$(document).trigger('remotestreamadded.jingle', [event, ob.sid]);
|
103
|
$(document).trigger('remotestreamadded.jingle', [event, ob.sid]);
|
98
|
};
|
104
|
};
|
99
|
this.peerconnection.onicecandidate = function (event) {
|
105
|
this.peerconnection.onicecandidate = function (event) {
|
|
|
|
|
481
|
// tell everyone about a new participants a=ssrc lines (isadd is true)
|
487
|
// tell everyone about a new participants a=ssrc lines (isadd is true)
|
482
|
// or a leaving participants a=ssrc lines
|
488
|
// or a leaving participants a=ssrc lines
|
483
|
// FIXME: should not take an SDP, but rather the a=ssrc lines and probably a=mid
|
489
|
// FIXME: should not take an SDP, but rather the a=ssrc lines and probably a=mid
|
484
|
-ColibriFocus.prototype.sendSSRCUpdate = function (sdp, exclude, isadd) {
|
|
|
|
|
490
|
+ColibriFocus.prototype.sendSSRCUpdate = function (sdp, jid, isadd) {
|
485
|
var ob = this;
|
491
|
var ob = this;
|
486
|
this.peers.forEach(function (peerjid) {
|
492
|
this.peers.forEach(function (peerjid) {
|
487
|
- if (peerjid == exclude) return;
|
|
|
488
|
- console.log('tell', peerjid, 'about ' + (isadd ? 'new' : 'removed') + ' ssrcs from', exclude);
|
|
|
|
|
493
|
+ if (peerjid == jid) return;
|
|
|
494
|
+ console.log('tell', peerjid, 'about ' + (isadd ? 'new' : 'removed') + ' ssrcs from', jid);
|
489
|
if (!ob.remotessrc[peerjid]) {
|
495
|
if (!ob.remotessrc[peerjid]) {
|
490
|
// FIXME: this should only send to participants that are stable, i.e. who have sent a session-accept
|
496
|
// FIXME: this should only send to participants that are stable, i.e. who have sent a session-accept
|
491
|
// possibly, this.remoteSSRC[session.peerjid] does not exist yet
|
497
|
// possibly, this.remoteSSRC[session.peerjid] does not exist yet
|
|
|
|
|
650
|
if (!this.remotessrc[session.peerjid] || participant == -1) {
|
656
|
if (!this.remotessrc[session.peerjid] || participant == -1) {
|
651
|
return;
|
657
|
return;
|
652
|
}
|
658
|
}
|
653
|
- console.log('remote ssrcs:', this.remotessrc[session.peerjid]);
|
|
|
654
|
var ssrcs = this.remotessrc[session.peerjid];
|
659
|
var ssrcs = this.remotessrc[session.peerjid];
|
655
|
for (var i = 0; i < ssrcs.length; i++) {
|
660
|
for (var i = 0; i < ssrcs.length; i++) {
|
656
|
if (!this.removessrc[i]) this.removessrc[i] = '';
|
661
|
if (!this.removessrc[i]) this.removessrc[i] = '';
|