diff options
author | Devaev Maxim <[email protected]> | 2018-11-06 07:06:13 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-11-06 07:06:13 +0300 |
commit | 236e51d956199abc9ed9bca8d44b988ec919bd50 (patch) | |
tree | 4a134484ad92d06913e0784dfd5a929fb9686c18 /web | |
parent | eb476ffdd2442e17cf07ad769a9b82d86cdc5eb1 (diff) |
dirty fix for fps
Diffstat (limited to 'web')
-rw-r--r-- | web/js/stream.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/web/js/stream.js b/web/js/stream.js index 59a544d3..f48dabff 100644 --- a/web/js/stream.js +++ b/web/js/stream.js @@ -7,7 +7,7 @@ function Stream() { var __resolution = {width: 640, height: 480}; var __size_factor = 1; var __client_id = ""; - var __fps = 0; + var __fps = -1; var __init__ = function() { $("stream-led").title = "Stream inactive"; @@ -60,7 +60,7 @@ function Stream() { $("stream-screenshot-button").disabled = true; __setStreamerControlsDisabled(true); __updateStreamHeader(false); - __fps = 0; + __fps = -1; __prev_state = false; } @@ -98,7 +98,7 @@ function Stream() { if (response.stream.clients_stat.hasOwnProperty(__client_id)) { __fps = response.stream.clients_stat[__client_id].fps; } else { - __fps = 0; + __fps = -1; } __updateStreamHeader(true); @@ -134,7 +134,8 @@ function Stream() { var el_grab = document.querySelector("#stream-window-header .window-grab"); var el_info = $("stream-info"); if (online) { - el_grab.innerHTML = el_info.innerHTML = "Stream – " + __resolution.width + "x" + __resolution.height + " / " + __fps + " fps"; + var fps_suffix = (__fps >= 0 ? " / " + __fps + " fps" : ""); + el_grab.innerHTML = el_info.innerHTML = "Stream – " + __resolution.width + "x" + __resolution.height + fps_suffix; } else { el_grab.innerHTML = el_info.innerHTML = "Stream – offline"; } |