浏览代码

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,8 +256,9 @@ JitsiConference.prototype.onMemberJoined = function (jid, email, nick) {
256 256
     this.eventEmitter.emit(JitsiConferenceEvents.USER_JOINED, id);
257 257
     this.participants[id] = participant;
258 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 262
             this.updateDTMFSupport();
262 263
         }.bind(this)
263 264
     );

+ 8
- 10
doc/example/example.js 查看文件

@@ -144,7 +144,7 @@ $(window).bind('unload', unload);
144 144
 
145 145
 // JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
146 146
 var initOptions = {
147
-    // disableAudioLevels: true,
147
+    disableAudioLevels: true,
148 148
     // Desktop sharing method. Can be set to 'ext', 'webrtc' or false to disable.
149 149
     desktopSharingChromeMethod: 'ext',
150 150
     // The ID of the jidesha extension for Chrome.
@@ -170,6 +170,13 @@ var initOptions = {
170 170
     desktopSharingFirefoxExtensionURL: null
171 171
 }
172 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 180
     JitsiMeetJS.createLocalTracks({devices: ["audio", "video"]}).
174 181
         then(onLocalTracks).catch(function (error) {
175 182
             console.log(error);
@@ -182,12 +189,3 @@ var connection = null;
182 189
 var room = null;
183 190
 var localTracks = [];
184 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,8 +291,9 @@ JitsiConference.prototype.onMemberJoined = function (jid, email, nick) {
291 291
     this.eventEmitter.emit(JitsiConferenceEvents.USER_JOINED, id);
292 292
     this.participants[id] = participant;
293 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 297
             this.updateDTMFSupport();
297 298
         }.bind(this)
298 299
     );
@@ -2523,17 +2524,23 @@ function handleLocalStream(streams, resolution) {
2523 2524
             }
2524 2525
         }
2525 2526
 
2527
+        if (streams && streams.desktopStream)
2528
+            desktopStream = streams.desktopStream;
2529
+
2526 2530
     }
2527 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 2544
             type: "video", videoType: "desktop"});
2538 2545
 
2539 2546
     if(audioStream)

+ 12
- 6
modules/RTC/RTCUtils.js 查看文件

@@ -378,17 +378,23 @@ function handleLocalStream(streams, resolution) {
378 378
             }
379 379
         }
380 380
 
381
+        if (streams && streams.desktopStream)
382
+            desktopStream = streams.desktopStream;
383
+
381 384
     }
382 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 398
             type: "video", videoType: "desktop"});
393 399
 
394 400
     if(audioStream)

正在加载...
取消
保存