mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 01:26:58 +00:00
tweaks
This commit is contained in:
@@ -361,6 +361,7 @@ if ($('#devices').is(':visible')) {
|
||||
</script>
|
||||
<!--<button data-inline="true" id="showdemo" onclick="toggle_demo();">View Demo Extensions</button>-->
|
||||
<button data-inline="true" id="showdevices" onclick="toggle_device();">View Device Settings</button>
|
||||
<button data-inline="true"id="speedbtn">Check Speed</button>
|
||||
<button data-inline="true"id="logoutbtn">Log Out</button>
|
||||
|
||||
<div id="devices" style="border-style:outset;border-width:2px">
|
||||
|
@@ -197,7 +197,46 @@ function check_vid() {
|
||||
return use_vid;
|
||||
}
|
||||
|
||||
// Attach audio output device to video element using device/sink ID.
|
||||
function do_speed_test(fn)
|
||||
{
|
||||
goto_page("bwtest");
|
||||
|
||||
vertoHandle.rpcClient.speedTest(1024 * 256, function(e, obj) {
|
||||
//console.error("Up: " + obj.upKPS, "Down: ", obj.downKPS);
|
||||
var vid = "default";
|
||||
if (outgoingBandwidth === "default") {
|
||||
outgoingBandwidth = Math.ceil(obj.upKPS * .75).toString();
|
||||
|
||||
$("#vqual_hd").prop("checked", true);
|
||||
vid = "1280x720";
|
||||
|
||||
if (outgoingBandwidth < 1024) {
|
||||
$("#vqual_vga").prop("checked", true);
|
||||
vid = "640x480";
|
||||
}
|
||||
if (outgoingBandwidth < 512) {
|
||||
$("#vqual_qvga").prop("checked", true);
|
||||
vid = "320x240";
|
||||
}
|
||||
}
|
||||
|
||||
if (incomingBandwidth === "default") {
|
||||
incomingBandwidth = Math.ceil(obj.downKPS * .75).toString();
|
||||
}
|
||||
|
||||
console.info(outgoingBandwidth, incomingBandwidth);
|
||||
|
||||
$("#bwinfo").html("<b>Bandwidth: " + "Up: " + obj.upKPS + " Down: " + obj.downKPS + " Vid: " + vid + "</b>");
|
||||
|
||||
if (fn) {
|
||||
fn();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Attach audio output device to video element using device/sink ID.
|
||||
|
||||
function attachSinkId(element, sinkId) {
|
||||
if (typeof element.sinkId !== 'undefined') {
|
||||
element.setSinkId(sinkId)
|
||||
@@ -559,54 +598,34 @@ var callbacks = {
|
||||
ringing = false;
|
||||
|
||||
if (success) {
|
||||
vertoHandle.rpcClient.speedTest(1024 * 256, function(e, obj) {
|
||||
//console.error("Up: " + obj.upKPS, "Down: ", obj.downKPS);
|
||||
var vid = "default";
|
||||
if (outgoingBandwidth === "default") {
|
||||
outgoingBandwidth = Math.ceil(obj.upKPS * .75).toString();
|
||||
|
||||
$("#vqual_hd").prop("checked", true);
|
||||
vid = "1280x720";
|
||||
|
||||
if (outgoingBandwidth < 1024) {
|
||||
$("#vqual_vga").prop("checked", true);
|
||||
vid = "640x480";
|
||||
}
|
||||
if (outgoingBandwidth < 512) {
|
||||
$("#vqual_qvga").prop("checked", true);
|
||||
vid = "320x240";
|
||||
}
|
||||
}
|
||||
|
||||
if (incomingBandwidth === "default") {
|
||||
incomingBandwidth = Math.ceil(obj.downKPS * .75).toString();
|
||||
}
|
||||
|
||||
console.info(outgoingBandwidth, incomingBandwidth);
|
||||
|
||||
$("#bwinfo").html("<b>Bandwidth: " + "Up: " + obj.upKPS + " Down: " + obj.downKPS + " Vid: " + vid + "</b>");
|
||||
do_speed_test(function() {
|
||||
|
||||
online(true);
|
||||
goto_page("main");
|
||||
|
||||
$("input[type='radio']").checkboxradio("refresh");
|
||||
$("input[type='checkbox']").checkboxradio("refresh");
|
||||
|
||||
|
||||
/*
|
||||
verto.subscribe("presence", {
|
||||
handler: function(v, e) {
|
||||
console.error("PRESENCE:", e);
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
if (!window.location.hash) {
|
||||
goto_page("main");
|
||||
}
|
||||
|
||||
if (autocall) {
|
||||
autocall = false;
|
||||
docall();
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
verto.subscribe("presence", {
|
||||
handler: function(v, e) {
|
||||
console.error("PRESENCE:", e);
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
if (!window.location.hash) {
|
||||
goto_page("main");
|
||||
}
|
||||
|
||||
if (autocall) {
|
||||
autocall = false;
|
||||
docall();
|
||||
}
|
||||
} else {
|
||||
goto_page("main");
|
||||
goto_dialog("login-error");
|
||||
@@ -1512,6 +1531,13 @@ function init() {
|
||||
$("#errordisplay").html("");
|
||||
});
|
||||
|
||||
$("#speedbtn").click(function() {
|
||||
do_speed_test(function() {
|
||||
goto_page("main");
|
||||
});
|
||||
$("#errordisplay").html("");
|
||||
});
|
||||
|
||||
$("#loginbtn").click(function() {
|
||||
online(false);
|
||||
vertoHandle.loginData({
|
||||
|
Reference in New Issue
Block a user