Переглянути джерело

Fix bug with starting recording multiple times.

j8
Boris Grozev 11 роки тому
джерело
коміт
8146655a70
1 змінених файлів з 3 додано та 5 видалено
  1. 3
    5
      libs/colibri/colibri.focus.js

+ 3
- 5
libs/colibri/colibri.focus.js Переглянути файл

@@ -172,7 +172,8 @@ ColibriFocus.prototype.makeConference = function (peers) {
172 172
 };
173 173
 
174 174
 // Sends a COLIBRI message which enables or disables (according to 'state') the
175
-// recording on the bridge.
175
+// recording on the bridge. Waits for the result IQ and calls 'callback' with
176
+// the new recording state, according to the IQ.
176 177
 ColibriFocus.prototype.setRecording = function(state, token, callback) {
177 178
     var self = this;
178 179
     var elem = $iq({to: this.bridgejid, type: 'get'});
@@ -187,10 +188,7 @@ ColibriFocus.prototype.setRecording = function(state, token, callback) {
187 188
         function (result) {
188 189
             console.log('Set recording "', state, '". Result:', result);
189 190
             var recordingElem = $(result).find('>conference>recording');
190
-            var newState = recordingElem.attr('state');
191
-            if (newState == null){
192
-                newState = false;
193
-            }
191
+            var newState = ('true' === recordingElem.attr('state'));
194 192
 
195 193
             self.recordingEnabled = newState;
196 194
             callback(newState);

Завантаження…
Відмінити
Зберегти