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

Fixes JS errors on FF. Fixes disco info JS error.

dev1
hristoterezov 9 роки тому
джерело
коміт
268d4e0adc
4 змінених файлів з 38 додано та 26 видалено
  1. 3
    2
      JitsiConference.js
  2. 8
    10
      doc/example/example.js
  3. 15
    8
      lib-jitsi-meet.js
  4. 12
    6
      modules/RTC/RTCUtils.js

+ 3
- 2
JitsiConference.js Переглянути файл

256
     this.eventEmitter.emit(JitsiConferenceEvents.USER_JOINED, id);
256
     this.eventEmitter.emit(JitsiConferenceEvents.USER_JOINED, id);
257
     this.participants[id] = participant;
257
     this.participants[id] = participant;
258
     this.connection.xmpp.connection.disco.info(
258
     this.connection.xmpp.connection.disco.info(
259
-        jid, "" /* node */, function(iq) {
260
-            participant._supportsDTMF = $(iq).find('>query>feature[var="urn:xmpp:jingle:dtmf:0"]').length > 0;
259
+        jid, "node", function(iq) {
260
+            participant._supportsDTMF = $(iq).find(
261
+                '>query>feature[var="urn:xmpp:jingle:dtmf:0"]').length > 0;
261
             this.updateDTMFSupport();
262
             this.updateDTMFSupport();
262
         }.bind(this)
263
         }.bind(this)
263
     );
264
     );

+ 8
- 10
doc/example/example.js Переглянути файл

144
 
144
 
145
 // JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
145
 // JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
146
 var initOptions = {
146
 var initOptions = {
147
-    // disableAudioLevels: true,
147
+    disableAudioLevels: true,
148
     // Desktop sharing method. Can be set to 'ext', 'webrtc' or false to disable.
148
     // Desktop sharing method. Can be set to 'ext', 'webrtc' or false to disable.
149
     desktopSharingChromeMethod: 'ext',
149
     desktopSharingChromeMethod: 'ext',
150
     // The ID of the jidesha extension for Chrome.
150
     // The ID of the jidesha extension for Chrome.
170
     desktopSharingFirefoxExtensionURL: null
170
     desktopSharingFirefoxExtensionURL: null
171
 }
171
 }
172
 JitsiMeetJS.init(initOptions).then(function(){
172
 JitsiMeetJS.init(initOptions).then(function(){
173
+    connection = new JitsiMeetJS.JitsiConnection(null, null, options);
174
+
175
+    connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED, onConnectionSuccess);
176
+    connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_FAILED, onConnectionFailed);
177
+    connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED, disconnect);
178
+
179
+    connection.connect();
173
     JitsiMeetJS.createLocalTracks({devices: ["audio", "video"]}).
180
     JitsiMeetJS.createLocalTracks({devices: ["audio", "video"]}).
174
         then(onLocalTracks).catch(function (error) {
181
         then(onLocalTracks).catch(function (error) {
175
             console.log(error);
182
             console.log(error);
182
 var room = null;
189
 var room = null;
183
 var localTracks = [];
190
 var localTracks = [];
184
 var remoteTracks = {};
191
 var remoteTracks = {};
185
-
186
-
187
-connection = new JitsiMeetJS.JitsiConnection(null, null, options);
188
-
189
-connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED, onConnectionSuccess);
190
-connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_FAILED, onConnectionFailed);
191
-connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED, disconnect);
192
-
193
-connection.connect();

+ 15
- 8
lib-jitsi-meet.js Переглянути файл

291
     this.eventEmitter.emit(JitsiConferenceEvents.USER_JOINED, id);
291
     this.eventEmitter.emit(JitsiConferenceEvents.USER_JOINED, id);
292
     this.participants[id] = participant;
292
     this.participants[id] = participant;
293
     this.connection.xmpp.connection.disco.info(
293
     this.connection.xmpp.connection.disco.info(
294
-        jid, "" /* node */, function(iq) {
295
-            participant._supportsDTMF = $(iq).find('>query>feature[var="urn:xmpp:jingle:dtmf:0"]').length > 0;
294
+        jid, "node", function(iq) {
295
+            participant._supportsDTMF = $(iq).find(
296
+                '>query>feature[var="urn:xmpp:jingle:dtmf:0"]').length > 0;
296
             this.updateDTMFSupport();
297
             this.updateDTMFSupport();
297
         }.bind(this)
298
         }.bind(this)
298
     );
299
     );
2523
             }
2524
             }
2524
         }
2525
         }
2525
 
2526
 
2527
+        if (streams && streams.desktopStream)
2528
+            desktopStream = streams.desktopStream;
2529
+
2526
     }
2530
     }
2527
     else if (RTCBrowserType.isFirefox() || RTCBrowserType.isTemasysPluginUsed()) {   // Firefox and Temasys plugin
2531
     else if (RTCBrowserType.isFirefox() || RTCBrowserType.isTemasysPluginUsed()) {   // Firefox and Temasys plugin
2528
-        if (streams && streams.audioStream)
2529
-            audioStream = streams.audioStream;
2532
+        if (streams && streams.audio)
2533
+            audioStream = streams.audio;
2534
+
2535
+        if (streams && streams.video)
2536
+            videoStream = streams.video;
2530
 
2537
 
2531
-        if (streams && streams.videoStream)
2532
-            videoStream = streams.videoStream;
2538
+        if(streams && streams.desktop)
2539
+            desktopStream = streams.desktop;
2533
     }
2540
     }
2534
 
2541
 
2535
-    if (streams && streams.desktopStream)
2536
-        res.push({stream: streams.desktopStream,
2542
+    if (desktopStream)
2543
+        res.push({stream: desktopStream,
2537
             type: "video", videoType: "desktop"});
2544
             type: "video", videoType: "desktop"});
2538
 
2545
 
2539
     if(audioStream)
2546
     if(audioStream)

+ 12
- 6
modules/RTC/RTCUtils.js Переглянути файл

378
             }
378
             }
379
         }
379
         }
380
 
380
 
381
+        if (streams && streams.desktopStream)
382
+            desktopStream = streams.desktopStream;
383
+
381
     }
384
     }
382
     else if (RTCBrowserType.isFirefox() || RTCBrowserType.isTemasysPluginUsed()) {   // Firefox and Temasys plugin
385
     else if (RTCBrowserType.isFirefox() || RTCBrowserType.isTemasysPluginUsed()) {   // Firefox and Temasys plugin
383
-        if (streams && streams.audioStream)
384
-            audioStream = streams.audioStream;
386
+        if (streams && streams.audio)
387
+            audioStream = streams.audio;
388
+
389
+        if (streams && streams.video)
390
+            videoStream = streams.video;
385
 
391
 
386
-        if (streams && streams.videoStream)
387
-            videoStream = streams.videoStream;
392
+        if(streams && streams.desktop)
393
+            desktopStream = streams.desktop;
388
     }
394
     }
389
 
395
 
390
-    if (streams && streams.desktopStream)
391
-        res.push({stream: streams.desktopStream,
396
+    if (desktopStream)
397
+        res.push({stream: desktopStream,
392
             type: "video", videoType: "desktop"});
398
             type: "video", videoType: "desktop"});
393
 
399
 
394
     if(audioStream)
400
     if(audioStream)

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