|
|
@@ -1066,28 +1066,28 @@ JingleSessionPC.prototype._modifySources = function (successCallback, queueCallb
|
|
1066
|
1066
|
|
|
1067
|
1067
|
/**
|
|
1068
|
1068
|
* Switches video streams.
|
|
1069
|
|
- * @param new_stream new stream that will be used as video of this session.
|
|
|
1069
|
+ * @param newStream new stream that will be used as video of this session.
|
|
1070
|
1070
|
* @param oldStream old video stream of this session.
|
|
1071
|
|
- * @param success_callback callback executed after successful stream switch.
|
|
|
1071
|
+ * @param successCallback callback executed after successful stream switch.
|
|
1072
|
1072
|
*/
|
|
1073
|
|
-JingleSessionPC.prototype.switchStreams = function (new_stream, oldStream, success_callback, isAudio) {
|
|
|
1073
|
+JingleSessionPC.prototype.switchStreams = function (newStream, oldStream, successCallback) {
|
|
1074
|
1074
|
|
|
1075
|
1075
|
var self = this;
|
|
1076
|
1076
|
|
|
1077
|
1077
|
// Remember SDP to figure out added/removed SSRCs
|
|
1078
|
1078
|
var oldSdp = null;
|
|
1079
|
|
- if(self.peerconnection) {
|
|
1080
|
|
- if(self.peerconnection.localDescription) {
|
|
|
1079
|
+ if (self.peerconnection) {
|
|
|
1080
|
+ if (self.peerconnection.localDescription) {
|
|
1081
|
1081
|
oldSdp = new SDP(self.peerconnection.localDescription.sdp);
|
|
1082
|
1082
|
}
|
|
1083
|
1083
|
self.peerconnection.removeStream(oldStream, true);
|
|
1084
|
|
- if(new_stream)
|
|
1085
|
|
- self.peerconnection.addStream(new_stream);
|
|
|
1084
|
+ if (newStream)
|
|
|
1085
|
+ self.peerconnection.addStream(newStream);
|
|
1086
|
1086
|
}
|
|
1087
|
1087
|
|
|
1088
|
1088
|
// Conference is not active
|
|
1089
|
|
- if(!oldSdp || !self.peerconnection) {
|
|
1090
|
|
- success_callback();
|
|
|
1089
|
+ if (!oldSdp) {
|
|
|
1090
|
+ successCallback();
|
|
1091
|
1091
|
return;
|
|
1092
|
1092
|
}
|
|
1093
|
1093
|
|
|
|
@@ -1095,7 +1095,7 @@ JingleSessionPC.prototype.switchStreams = function (new_stream, oldStream, succe
|
|
1095
|
1095
|
self.modifySourcesQueue.push(function() {
|
|
1096
|
1096
|
console.log('modify sources done');
|
|
1097
|
1097
|
|
|
1098
|
|
- success_callback();
|
|
|
1098
|
+ successCallback();
|
|
1099
|
1099
|
|
|
1100
|
1100
|
var newSdp = new SDP(self.peerconnection.localDescription.sdp);
|
|
1101
|
1101
|
console.log("SDPs", oldSdp, newSdp);
|