提交 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 @@ ...@@ -76,6 +76,7 @@
useVideo: null, useVideo: null,
useStereo: false, useStereo: false,
userData: null, userData: null,
iceServers: false,
videoParams: {}, videoParams: {},
callbacks: { callbacks: {
onICEComplete: function() {}, onICEComplete: function() {},
...@@ -305,6 +306,7 @@ ...@@ -305,6 +306,7 @@
return onChannelError(self, e); return onChannelError(self, e);
}, },
constraints: self.constraints, constraints: self.constraints,
iceServers: self.options.iceServers,
offerSDP: { offerSDP: {
type: "offer", type: "offer",
sdp: self.remoteSDP sdp: self.remoteSDP
...@@ -364,7 +366,8 @@ ...@@ -364,7 +366,8 @@
onChannelError: function(e) { onChannelError: function(e) {
return onChannelError(self, e); return onChannelError(self, e);
}, },
constraints: self.constraints constraints: self.constraints,
iceServers: self.options.iceServers,
}); });
onStreamSuccess(self); onStreamSuccess(self);
...@@ -418,19 +421,34 @@ ...@@ -418,19 +421,34 @@
credential: 'homeo' credential: 'homeo'
}; };
var iceServers = { var iceServers = null;
iceServers: options.iceServers || [STUN]
}; if (options.iceServers) {
var tmp = options.iceServers;;
if (!moz && !options.iceServers) { if (typeof(tmp) === "boolean") {
if (parseInt(navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)[2]) >= 28) TURN = { tmp = null;
url: 'turn:turn.bistri.com:80', }
credential: 'homeo',
username: 'homeo' 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 = { var optional = {
optional: [] optional: []
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
socketUrl: null, socketUrl: null,
tag: null, tag: null,
videoParams: {}, videoParams: {},
iceServers: false,
ringSleep: 6000 ringSleep: 6000
}, },
options); options);
...@@ -1487,6 +1488,7 @@ ...@@ -1487,6 +1488,7 @@
useAudio: dialog.audioStream, useAudio: dialog.audioStream,
useStereo: dialog.params.useStereo, useStereo: dialog.params.useStereo,
videoParams: verto.options.videoParams, videoParams: verto.options.videoParams,
iceServers: verto.options.iceServers
}); });
dialog.rtc.verto = dialog.verto; dialog.rtc.verto = dialog.verto;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论