提交 07f80945 authored 作者: Anthony Minessale's avatar Anthony Minessale

add checkbox to demo to use stun or not

上级 f629b5ed
......@@ -223,6 +223,7 @@
<br>
<label><input id="use_vid" type="checkbox" value="foo" > Use Video</label>
<label><input id="use_stereo" type="checkbox" value="foo" > Stereo Audio</label>
<label><input id="use_stun" type="checkbox" value="foo" > Use STUN</label>
<br>
<!--
<b>TEXT</b><br>To: <input type="text" size="20" id="textto"/> MSG: <input type="text" size="40" id="textmsg"/>
......
This diff was suppressed by a .gitattributes entry.
......@@ -384,6 +384,23 @@ function init() {
});
});
tmp = $.cookie("verto_demo_stun_checked") || "false";
$.cookie("verto_demo_stun_checked", tmp, {
expires: 365
});
$("#use_stun").prop("checked", tmp === "true").change(function(e) {
tmp = $("#use_stun").is(':checked');
$.cookie("verto_demo_stun_checked", tmp ? "true" : "false", {
expires: 365
});
if (verto) {
verto.iceServers(tmp);
}
alert(tmp);
});
verto = new $.verto({
login: $("#login").val() + "@" + $("#hostName").val(),
passwd: $("#passwd").val(),
......@@ -393,7 +410,8 @@ function init() {
videoParams: {
"minWidth": "1280",
"minHeight": "720"
}
},
iceServers: $("#use_stun").is(':checked')
},callbacks);
$("#login").change(function(e) {
......
......@@ -120,6 +120,12 @@
};
$.verto.prototype.iceServers = function(on) {
var verto = this;
verto.options.iceServers = on;
};
$.verto.prototype.loginData = function(params) {
verto.options.login = params.login;
verto.options.passwd = params.passwd;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论