ソースを参照

get stun and turn credentials from server

master
Philipp Hancke 11年前
コミット
edf3fc64b0
2個のファイルの変更3行の追加1行の削除
  1. 1
    0
      app.js
  2. 2
    1
      libs/strophejingle.bundle.js

+ 1
- 0
app.js ファイルの表示

@@ -34,6 +34,7 @@ function init() {
34 34
     connection.connect(jid, document.getElementById('password').value, function (status) {
35 35
         if (status == Strophe.Status.CONNECTED) {
36 36
             console.log('connected');
37
+            connection.jingle.getStunAndTurnCredentials();
37 38
             if (RTC.browser == 'firefox') {
38 39
                 getUserMediaWithConstraints(['audio']);
39 40
             } else {

+ 2
- 1
libs/strophejingle.bundle.js ファイルの表示

@@ -571,6 +571,7 @@ Strophe.addConnectionPlugin('jingle', {
571 571
         // validity have to be fetched before creating the peerconnection
572 572
         // TODO: implement refresh via updateIce as described in
573 573
         //      https://code.google.com/p/webrtc/issues/detail?id=1650
574
+        var self = this;
574 575
         this.connection.sendIQ(
575 576
             $iq({type: 'get', to: this.connection.domain})
576 577
                 .c('services', {xmlns: 'urn:xmpp:extdisco:1'}).c('service', {host: 'turn.' + this.connection.domain}),
@@ -610,7 +611,7 @@ Strophe.addConnectionPlugin('jingle', {
610 611
                         break;
611 612
                     }
612 613
                 });
613
-                this.ice_config.iceServers = iceservers;
614
+                self.ice_config.iceServers = iceservers;
614 615
             },
615 616
             function (err) {
616 617
                 console.warn('getting turn credentials failed', err);

読み込み中…
キャンセル
保存