|
|
@@ -128,9 +128,16 @@ JingleSessionPC.prototype.doInitialize = function () {
|
|
128
|
128
|
};
|
|
129
|
129
|
this.peerconnection.onremovestream = function (event) {
|
|
130
|
130
|
// Remove the stream from remoteStreams
|
|
131
|
|
- // FIXME: remotestreamremoved.jingle not defined anywhere(unused)
|
|
132
|
|
-
|
|
133
|
|
- $(document).trigger('remotestreamremoved.jingle', [event, self.sid]);
|
|
|
131
|
+ if (event.stream.id !== 'default') {
|
|
|
132
|
+ logger.log("REMOTE STREAM REMOVED: ", event.stream , event.stream.id);
|
|
|
133
|
+ self.remoteStreamRemoved(event);
|
|
|
134
|
+ } else {
|
|
|
135
|
+ // This is a recvonly stream. Clients that implement Unified Plan,
|
|
|
136
|
+ // such as Firefox use recvonly "streams/channels/tracks" for
|
|
|
137
|
+ // receiving remote stream/tracks, as opposed to Plan B where there
|
|
|
138
|
+ // are only 3 channels: audio, video and data.
|
|
|
139
|
+ logger.log("RECVONLY REMOTE STREAM IGNORED: " + event.stream + " - " + event.stream.id);
|
|
|
140
|
+ }
|
|
134
|
141
|
};
|
|
135
|
142
|
this.peerconnection.onsignalingstatechange = function (event) {
|
|
136
|
143
|
if (!(self && self.peerconnection)) return;
|
|
|
@@ -1381,6 +1388,20 @@ JingleSessionPC.prototype.remoteStreamAdded = function (data, times) {
|
|
1381
|
1388
|
}
|
|
1382
|
1389
|
}
|
|
1383
|
1390
|
|
|
|
1391
|
+/**
|
|
|
1392
|
+ * Handles remote stream removal.
|
|
|
1393
|
+ * @param event The event object associated with the removal.
|
|
|
1394
|
+ */
|
|
|
1395
|
+JingleSessionPC.prototype.remoteStreamRemoved = function (event) {
|
|
|
1396
|
+ var thessrc;
|
|
|
1397
|
+ var streamId = RTC.getStreamID(event.stream);
|
|
|
1398
|
+ if (!streamId) {
|
|
|
1399
|
+ logger.error("No stream ID for", event.stream);
|
|
|
1400
|
+ } else if (streamId && streamId.indexOf('mixedmslabel') === -1) {
|
|
|
1401
|
+ this.room.eventEmitter.emit(XMPPEvents.REMOTE_STREAM_REMOVED, streamId);
|
|
|
1402
|
+ }
|
|
|
1403
|
+}
|
|
|
1404
|
+
|
|
1384
|
1405
|
/**
|
|
1385
|
1406
|
* Returns the ice connection state for the peer connection.
|
|
1386
|
1407
|
* @returns the ice connection state for the peer connection.
|