diff options
author | garykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-13 19:47:37 +0000 |
---|---|---|
committer | garykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-13 19:47:37 +0000 |
commit | 7a8dfbf6b4882cd941be4fed8fae57d00f835b61 (patch) | |
tree | 996d3d6ad00f585cd0d99530310c4d83a0e68bd3 /remoting/client/appengine | |
parent | 9b9c0982980ef977cd2b6d8e4b8af0c56663d904 (diff) | |
download | chromium_src-7a8dfbf6b4882cd941be4fed8fae57d00f835b61.zip chromium_src-7a8dfbf6b4882cd941be4fed8fae57d00f835b61.tar.gz chromium_src-7a8dfbf6b4882cd941be4fed8fae57d00f835b61.tar.bz2 |
Add basic video stats to Chromoting client status bar.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6838005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81461 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/appengine')
-rw-r--r-- | remoting/client/appengine/static_files/chromoting_session.js | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/remoting/client/appengine/static_files/chromoting_session.js b/remoting/client/appengine/static_files/chromoting_session.js index 8c7b216..a0cd13c 100644 --- a/remoting/client/appengine/static_files/chromoting_session.js +++ b/remoting/client/appengine/static_files/chromoting_session.js @@ -115,7 +115,7 @@ function init() { console.log('connect request received: ' + chromoting.hostname + ' by ' + chromoting.username); - // TODO(garykac): Clean exit if |connect| isn't a funtion. + // TODO(garykac): Clean exit if |connect| isn't a function. if (typeof plugin.connect === 'function') { if (chromoting.connectMethod == "sandboxed") { registerConnection(); @@ -128,6 +128,8 @@ function init() { } document.getElementById('title').innerText = chromoting.hostname; + + window.setTimeout("updateStatusBarStats()", 1000); } function toggleDebugLog() { @@ -328,3 +330,28 @@ function addToDebugLog(message) { // Scroll to bottom of div debugLog.scrollTop = debugLog.scrollHeight; } + +/** + * Show a client message for the specified amount of time. + * + * @param {string} message The message to display. + */ +function updateStatusBarStats() { + var videoBandwidth = chromoting.plugin.videoBandwidth; + var videoCaptureLatency = chromoting.plugin.videoCaptureLatency; + var videoEncodeLatency = chromoting.plugin.videoEncodeLatency; + var videoDecodeLatency = chromoting.plugin.videoDecodeLatency; + var videoRenderLatency = chromoting.plugin.videoRenderLatency; + + var status = document.getElementById('status_msg'); + status.innerText = "Video stats: bandwidth: " + videoBandwidth + + ", Latency: capture: " + videoCaptureLatency + + ", encode: " + videoEncodeLatency + + ", decode: " + videoDecodeLatency + + ", render: " + videoRenderLatency; + status.style.opacity = 1; + status.style.display = ''; + + // Update the stats once per second. + window.setTimeout("updateStatusBarStats()", 1000); +} |