Uses the type of the turn coming from the server turn or turns.
This commit is contained in:
parent
9d98b3a29e
commit
d148161a42
|
@ -253,7 +253,8 @@ Strophe.addConnectionPlugin('jingle', {
|
||||||
$(res).find('>services>service').each(function (idx, el) {
|
$(res).find('>services>service').each(function (idx, el) {
|
||||||
el = $(el);
|
el = $(el);
|
||||||
var dict = {};
|
var dict = {};
|
||||||
switch (el.attr('type')) {
|
var type = el.attr('type');
|
||||||
|
switch (type) {
|
||||||
case 'stun':
|
case 'stun':
|
||||||
dict.url = 'stun:' + el.attr('host');
|
dict.url = 'stun:' + el.attr('host');
|
||||||
if (el.attr('port')) {
|
if (el.attr('port')) {
|
||||||
|
@ -262,7 +263,8 @@ Strophe.addConnectionPlugin('jingle', {
|
||||||
iceservers.push(dict);
|
iceservers.push(dict);
|
||||||
break;
|
break;
|
||||||
case 'turn':
|
case 'turn':
|
||||||
dict.url = 'turn:';
|
case 'turns':
|
||||||
|
dict.url = type + ':';
|
||||||
if (el.attr('username')) { // https://code.google.com/p/webrtc/issues/detail?id=1508
|
if (el.attr('username')) { // https://code.google.com/p/webrtc/issues/detail?id=1508
|
||||||
if (navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./) && parseInt(navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)[2], 10) < 28) {
|
if (navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./) && parseInt(navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)[2], 10) < 28) {
|
||||||
dict.url += el.attr('username') + '@';
|
dict.url += el.attr('username') + '@';
|
||||||
|
|
Loading…
Reference in New Issue