summaryrefslogtreecommitdiff
path: root/web/share/js/kvm/stream.js
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2021-10-18 08:46:53 +0300
committerMaxim Devaev <[email protected]>2021-10-18 08:46:53 +0300
commite2873032eedb341a9a21686ad216ee87bf114f4d (patch)
tree4e887affa7f20f276f4f756d3ec0a48f117ebf53 /web/share/js/kvm/stream.js
parentb4ca93dac1585b63e316287d66cecfbc8e00590c (diff)
slider setValue/getValue
Diffstat (limited to 'web/share/js/kvm/stream.js')
-rw-r--r--web/share/js/kvm/stream.js13
1 files changed, 3 insertions, 10 deletions
diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js
index 9aa77545..15a62194 100644
--- a/web/share/js/kvm/stream.js
+++ b/web/share/js/kvm/stream.js
@@ -508,17 +508,17 @@ export function Streamer() {
if (state.streamer) {
tools.el.setEnabled($("stream-quality-slider"), true);
- __setIfChanged($("stream-quality-slider"), state.streamer.encoder.quality, __updateQualityValue);
+ tools.slider.setValue($("stream-quality-slider"), state.streamer.encoder.quality, __updateQualityValue);
if (state.features.h264 && __janus_enabled) {
__setMinMax($("stream-h264-bitrate-slider"), state.limits.h264_bitrate);
tools.el.setEnabled($("stream-h264-bitrate-slider"), true);
- __setIfChanged($("stream-h264-bitrate-slider"), state.streamer.h264.bitrate, __updateH264BitrateValue);
+ tools.slider.setValue($("stream-h264-bitrate-slider"), state.streamer.h264.bitrate, __updateH264BitrateValue);
}
__setMinMax($("stream-desired-fps-slider"), state.limits.desired_fps);
tools.el.setEnabled($("stream-desired-fps-slider"), true);
- __setIfChanged($("stream-desired-fps-slider"), state.streamer.source.desired_fps, __updateDesiredFpsValue);
+ tools.slider.setValue($("stream-desired-fps-slider"), state.streamer.source.desired_fps, __updateDesiredFpsValue);
let resolution_str = __makeStringResolution(state.streamer.source.resolution);
if (__makeStringResolution(__resolution) !== resolution_str) {
@@ -597,13 +597,6 @@ export function Streamer() {
el.max = limits.max;
};
- var __setIfChanged = function(el, value, callback) {
- if (el.value !== value) {
- el.value = value;
- callback(value);
- }
- };
-
var __updateQualityValue = function(value) {
$("stream-quality-value").innerHTML = `${value}%`;
};