diff options
author | Devaev Maxim <[email protected]> | 2021-07-01 09:22:18 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2021-07-01 09:22:18 +0300 |
commit | 4fe20641da44e25eb394d7ce26776b7ee6ce7c10 (patch) | |
tree | 0133c3caddd3b1c1b48af11b7e7c235e21bfeb5f /web/share/js/kvm/stream.js | |
parent | 2995ca4909b171052aebf1497580cc797cb95f19 (diff) |
save video mode
Diffstat (limited to 'web/share/js/kvm/stream.js')
-rw-r--r-- | web/share/js/kvm/stream.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js index 1596816c..272df998 100644 --- a/web/share/js/kvm/stream.js +++ b/web/share/js/kvm/stream.js @@ -459,6 +459,7 @@ export function Streamer() { __janus_enabled = (enabled && supported && _Janus !== null); tools.featureSetEnabled($("stream-mode"), __janus_enabled); tools.info(`Stream: Janus WebRTC state: enabled=${enabled}, supported=${supported}, imported=${!!_Janus}`); + tools.radioClickValue("stream-mode-radio", tools.storage.get("stream.mode", "mjpeg")); self.setState(__state); }; if (enabled && supported) { @@ -609,16 +610,17 @@ export function Streamer() { var __clickModeRadio = function() { if (_Janus !== null) { let mode = tools.radioGetValue("stream-mode-radio"); + tools.storage.set("stream.mode", mode); if (mode !== __streamer.getMode()) { setTimeout(() => tools.radioSetValue("stream-mode-radio", mode), 100); - tools.hiddenSetVisible($("stream-image"), (mode === "mjpeg")); - tools.hiddenSetVisible($("stream-video"), (mode !== "mjpeg")); - if (mode === "mjpeg") { - __streamer.stopStream(); - __streamer = new _MjpegStreamer(__setActive, __setInactive, __setInfo); - } else { // janus + tools.hiddenSetVisible($("stream-image"), (mode !== "janus")); + tools.hiddenSetVisible($("stream-video"), (mode === "janus")); + if (mode === "janus") { __streamer.stopStream(); __streamer = new _JanusStreamer(__setActive, __setInactive, __setInfo); + } else { // mjpeg + __streamer.stopStream(); + __streamer = new _MjpegStreamer(__setActive, __setInactive, __setInfo); } if (wm.isWindowVisible($("stream-window"))) { __streamer.ensureStream(__state); |