提交 40bb7b7b authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-6707 #resolve #comment add the param iceServers to verto constructor. …

FS-6707 #resolve #comment add the param iceServers to verto constructor.  possible values: true: enables previous behaviour, false: nowthe default, use no iceServers, ARRAY of iceServer objects: this object will be passed into the browser as-is
上级 5a7144c4
This diff was suppressed by a .gitattributes entry.
......@@ -76,6 +76,7 @@
useVideo: null,
useStereo: false,
userData: null,
iceServers: false,
videoParams: {},
callbacks: {
onICEComplete: function() {},
......@@ -305,6 +306,7 @@
return onChannelError(self, e);
},
constraints: self.constraints,
iceServers: self.options.iceServers,
offerSDP: {
type: "offer",
sdp: self.remoteSDP
......@@ -364,7 +366,8 @@
onChannelError: function(e) {
return onChannelError(self, e);
},
constraints: self.constraints
constraints: self.constraints,
iceServers: self.options.iceServers,
});
onStreamSuccess(self);
......@@ -418,19 +421,34 @@
credential: 'homeo'
};
var iceServers = {
iceServers: options.iceServers || [STUN]
};
var iceServers = null;
if (options.iceServers) {
var tmp = options.iceServers;;
if (!moz && !options.iceServers) {
if (parseInt(navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)[2]) >= 28) TURN = {
url: 'turn:turn.bistri.com:80',
credential: 'homeo',
username: 'homeo'
if (typeof(tmp) === "boolean") {
tmp = null;
}
if (tmp && typeof(tmp) !== "array") {
console.warn("iceServers must be an array, reverting to default ice servers");
tmp = null;
}
iceServers = {
iceServers: tmp || [STUN]
};
iceServers.iceServers = [STUN];
}
if (!moz && !tmp) {
if (parseInt(navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)[2]) >= 28) TURN = {
url: 'turn:turn.bistri.com:80',
credential: 'homeo',
username: 'homeo'
};
iceServers.iceServers = [STUN];
}
}
var optional = {
optional: []
......
......@@ -72,6 +72,7 @@
socketUrl: null,
tag: null,
videoParams: {},
iceServers: false,
ringSleep: 6000
},
options);
......@@ -1487,6 +1488,7 @@
useAudio: dialog.audioStream,
useStereo: dialog.params.useStereo,
videoParams: verto.options.videoParams,
iceServers: verto.options.iceServers
});
dialog.rtc.verto = dialog.verto;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论