Просмотр исходного кода

Switches the order of the parameters of desktopsharing.addListener to match the rest of the code. Renames variables.

dev1
Boris Grozev 10 лет назад
Родитель
Сommit
0f2adba7f4
2 измененных файлов: 16 добавлений и 15 удалений
  1. 5
    5
      modules/RTC/RTC.js
  2. 11
    10
      modules/xmpp/JingleSessionPC.js

+ 5
- 5
modules/RTC/RTC.js Просмотреть файл

@@ -22,10 +22,10 @@ function RTC(room, options) {
22 22
     this.eventEmitter = new EventEmitter();
23 23
     var self = this;
24 24
     this.options = options || {};
25
-    desktopsharing.addListener(
25
+    desktopsharing.addListener(DesktopSharingEventTypes.NEW_STREAM_CREATED,
26 26
         function (stream, isUsingScreenStream, callback) {
27 27
             self.changeLocalVideo(stream, isUsingScreenStream, callback);
28
-        }, DesktopSharingEventTypes.NEW_STREAM_CREATED);
28
+        });
29 29
     room.addPresenceListener("videomuted", function (values, from) {
30 30
         if(self.remoteStreams[from])
31 31
             self.remoteStreams[from][JitsiTrack.VIDEO].setMute(values.value == "true");
@@ -208,13 +208,13 @@ RTC.prototype.muteRemoteVideoStream = function (jid, value) {
208 208
     return false;
209 209
 };
210 210
 
211
-RTC.prototype.switchVideoStreams = function (new_stream) {
212
-    this.localVideo.stream = new_stream;
211
+RTC.prototype.switchVideoStreams = function (newStream) {
212
+    this.localVideo.stream = newStream;
213 213
 
214 214
     this.localStreams = [];
215 215
 
216 216
     //in firefox we have only one stream object
217
-    if (this.localAudio.getOriginalStream() != new_stream)
217
+    if (this.localAudio.getOriginalStream() != newStream)
218 218
         this.localStreams.push(this.localAudio);
219 219
     this.localStreams.push(this.localVideo);
220 220
 };

+ 11
- 10
modules/xmpp/JingleSessionPC.js Просмотреть файл

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

Загрузка…
Отмена
Сохранить