From 84563553b8a2f00bbb4b1559029f77ad225627f4 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Sun, 19 Mar 2023 01:17:31 +0200 Subject: fixed msd parts api --- web/share/js/kvm/stream.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'web/share/js/kvm/stream.js') diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js index 0239a27b..9a73ea56 100644 --- a/web/share/js/kvm/stream.js +++ b/web/share/js/kvm/stream.js @@ -176,19 +176,13 @@ export function Streamer() { } if (state.features.resolution) { - if ($("stream-resolution-selector").resolutions !== state.limits.available_resolutions) { - let resolutions_html = ""; - for (let variant of state.limits.available_resolutions) { - resolutions_html += ``; - } - if (!state.limits.available_resolutions.includes(resolution_str)) { - resolutions_html += ``; - } - $("stream-resolution-selector").innerHTML = resolutions_html; - $("stream-resolution-selector").resolutions = state.limits.available_resolutions; + let el = $("stream-resolution-selector"); + if (!state.limits.available_resolutions.includes(resolution_str)) { + state.limits.available_resolutions.push(resolution_str); } - document.querySelector(`#stream-resolution-selector [value="${resolution_str}"]`).selected = true; - tools.el.setEnabled($("stream-resolution-selector"), true); + tools.selector.setValues(el, state.limits.available_resolutions); + tools.selector.setSelectedValue(el, resolution_str); + tools.el.setEnabled(el, true); } } else { -- cgit v1.2.3