diff options
author | Devaev Maxim <[email protected]> | 2019-09-20 00:41:41 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-09-20 00:41:41 +0300 |
commit | 3b7a84d0d73904bc448d4875089ff872be68ab8e (patch) | |
tree | 969e8c02ad9208d2dc18bbdf22b60a61fd582f49 /web | |
parent | aaa60e63a4b66f275d52dc44c8e8198ee52b09e2 (diff) |
show last frame as blank
Diffstat (limited to 'web')
-rw-r--r-- | web/share/js/kvm/stream.js | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js index 48908b60..8338805c 100644 --- a/web/share/js/kvm/stream.js +++ b/web/share/js/kvm/stream.js @@ -101,8 +101,6 @@ export function Streamer() { } if (__ensureStream(state.stream.clients_stat)) { - $("stream-image").className = "stream-image-active"; - $("stream-box").classList.remove("stream-box-inactive"); $("stream-led").className = "led-green"; $("stream-led").title = "Stream is active"; wm.switchDisabled($("stream-screenshot-button"), false); @@ -112,11 +110,9 @@ export function Streamer() { tools.info("Stream: active"); } - __updateStreamHeader(true); + __updateStreamWindow(true, state.source.online); } else { - $("stream-image").className = "stream-image-inactive"; - $("stream-box").classList.add("stream-box-inactive"); $("stream-led").className = "led-gray"; $("stream-led").title = "Stream inactive"; wm.switchDisabled($("stream-screenshot-button"), true); @@ -125,7 +121,7 @@ export function Streamer() { wm.switchDisabled($("stream-desired-fps-slider"), true); tools.info("Stream: inactive"); - __updateStreamHeader(false); + __updateStreamWindow(false, false); } }; @@ -161,14 +157,29 @@ export function Streamer() { } }; - var __updateStreamHeader = function(online) { + var __updateStreamWindow = function(is_active, online) { + if (online) { + $("stream-image").className = "stream-image-active"; + $("stream-box").classList.remove("stream-box-inactive"); + } else { + $("stream-image").className = "stream-image-inactive"; + $("stream-box").classList.add("stream-box-inactive"); + } + let el_grab = document.querySelector("#stream-window-header .window-grab"); let el_info = $("stream-info"); - if (online) { - let fps_suffix = (__client_fps >= 0 ? ` / ${__client_fps} fps` : ""); - el_grab.innerHTML = el_info.innerHTML = `Stream – ${__resolution.width}x${__resolution.height}${fps_suffix}`; + if (is_active) { + let title = "Stream – "; + if (!online) { + title += "no signal / "; + } + title += `${__resolution.width}x${__resolution.height}`; + if (__client_fps >= 0) { + title += ` / ${__client_fps} fps`; + } + el_grab.innerHTML = el_info.innerHTML = title; } else { - el_grab.innerHTML = el_info.innerHTML = "Stream – offline"; + el_grab.innerHTML = el_info.innerHTML = "Stream – inactive"; } }; |