get stun and turn credentials from server
This commit is contained in:
parent
f063aacc92
commit
edf3fc64b0
1
app.js
1
app.js
|
@ -34,6 +34,7 @@ function init() {
|
||||||
connection.connect(jid, document.getElementById('password').value, function (status) {
|
connection.connect(jid, document.getElementById('password').value, function (status) {
|
||||||
if (status == Strophe.Status.CONNECTED) {
|
if (status == Strophe.Status.CONNECTED) {
|
||||||
console.log('connected');
|
console.log('connected');
|
||||||
|
connection.jingle.getStunAndTurnCredentials();
|
||||||
if (RTC.browser == 'firefox') {
|
if (RTC.browser == 'firefox') {
|
||||||
getUserMediaWithConstraints(['audio']);
|
getUserMediaWithConstraints(['audio']);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -571,6 +571,7 @@ Strophe.addConnectionPlugin('jingle', {
|
||||||
// validity have to be fetched before creating the peerconnection
|
// validity have to be fetched before creating the peerconnection
|
||||||
// TODO: implement refresh via updateIce as described in
|
// TODO: implement refresh via updateIce as described in
|
||||||
// https://code.google.com/p/webrtc/issues/detail?id=1650
|
// https://code.google.com/p/webrtc/issues/detail?id=1650
|
||||||
|
var self = this;
|
||||||
this.connection.sendIQ(
|
this.connection.sendIQ(
|
||||||
$iq({type: 'get', to: this.connection.domain})
|
$iq({type: 'get', to: this.connection.domain})
|
||||||
.c('services', {xmlns: 'urn:xmpp:extdisco:1'}).c('service', {host: 'turn.' + this.connection.domain}),
|
.c('services', {xmlns: 'urn:xmpp:extdisco:1'}).c('service', {host: 'turn.' + this.connection.domain}),
|
||||||
|
@ -610,7 +611,7 @@ Strophe.addConnectionPlugin('jingle', {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.ice_config.iceServers = iceservers;
|
self.ice_config.iceServers = iceservers;
|
||||||
},
|
},
|
||||||
function (err) {
|
function (err) {
|
||||||
console.warn('getting turn credentials failed', err);
|
console.warn('getting turn credentials failed', err);
|
||||||
|
|
Loading…
Reference in New Issue