summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-11-15 15:39:39 +0300
committerMaxim Devaev <[email protected]>2022-11-15 15:39:39 +0300
commitda6ad16e325f6c7a3e422153f170e1cc2fa1c39c (patch)
tree50f085211caa2547ee9877328089d92dc8809f1b /web
parentd096ad32633199e43c2556558ed56b700c58e33b (diff)
Fixed pikvm/pikvm#869: Set slider values before limits
Diffstat (limited to 'web')
-rw-r--r--web/share/js/kvm/stream.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js
index 5e18e74d..3a1df717 100644
--- a/web/share/js/kvm/stream.js
+++ b/web/share/js/kvm/stream.js
@@ -596,18 +596,15 @@ export function Streamer() {
tools.slider.setValue($("stream-quality-slider"), state.streamer.encoder.quality);
if (state.features.h264 && __janus_enabled) {
- __setMinMax($("stream-h264-bitrate-slider"), state.limits.h264_bitrate);
+ __setValueAndLimits($("stream-h264-bitrate-slider"), state.streamer.h264.bitrate, state.limits.h264_bitrate);
tools.el.setEnabled($("stream-h264-bitrate-slider"), true);
- tools.slider.setValue($("stream-h264-bitrate-slider"), state.streamer.h264.bitrate);
- __setMinMax($("stream-h264-gop-slider"), state.limits.h264_gop);
+ __setValueAndLimits($("stream-h264-gop-slider"), state.streamer.h264.gop, state.limits.h264_gop);
tools.el.setEnabled($("stream-h264-gop-slider"), true);
- tools.slider.setValue($("stream-h264-gop-slider"), state.streamer.h264.gop);
}
- __setMinMax($("stream-desired-fps-slider"), state.limits.desired_fps);
+ __setValueAndLimits($("stream-desired-fps-slider"), state.streamer.source.desired_fps, state.limits.desired_fps);
tools.el.setEnabled($("stream-desired-fps-slider"), true);
- tools.slider.setValue($("stream-desired-fps-slider"), state.streamer.source.desired_fps);
let resolution_str = __makeStringResolution(state.streamer.source.resolution);
if (__makeStringResolution(__resolution) !== resolution_str) {
@@ -682,7 +679,8 @@ export function Streamer() {
el_grab.innerHTML = el_info.innerHTML = title;
};
- var __setMinMax = function(el, limits) {
+ var __setValueAndLimits = function(el, value, limits) {
+ tools.slider.setValue(el, value);
el.min = limits.min;
el.max = limits.max;
};