]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Add UI for quality setting
authorPierre Ossman <ossman@cendio.se>
Fri, 28 Feb 2020 13:52:56 +0000 (14:52 +0100)
committerPierre Ossman <ossman@cendio.se>
Fri, 28 Feb 2020 13:54:09 +0000 (14:54 +0100)
app/ui.js
docs/EMBEDDING.md
vnc.html

index 0268f46238dfcdc3c646adfc1d028e73e89d547b..d118c84fc591762133be0f27208e9194b1576002 100644 (file)
--- a/app/ui.js
+++ b/app/ui.js
@@ -161,6 +161,7 @@ const UI = {
         UI.initSetting('encrypt', (window.location.protocol === "https:"));
         UI.initSetting('view_clip', false);
         UI.initSetting('resize', 'off');
+        UI.initSetting('quality', 6);
         UI.initSetting('shared', true);
         UI.initSetting('view_only', false);
         UI.initSetting('show_dot', false);
@@ -347,6 +348,8 @@ const UI = {
         UI.addSettingChangeHandler('resize');
         UI.addSettingChangeHandler('resize', UI.applyResizeMode);
         UI.addSettingChangeHandler('resize', UI.updateViewClip);
+        UI.addSettingChangeHandler('quality');
+        UI.addSettingChangeHandler('quality', UI.updateQuality);
         UI.addSettingChangeHandler('view_clip');
         UI.addSettingChangeHandler('view_clip', UI.updateViewClip);
         UI.addSettingChangeHandler('shared');
@@ -829,6 +832,7 @@ const UI = {
         UI.updateSetting('encrypt');
         UI.updateSetting('view_clip');
         UI.updateSetting('resize');
+        UI.updateSetting('quality');
         UI.updateSetting('shared');
         UI.updateSetting('view_only');
         UI.updateSetting('path');
@@ -1030,6 +1034,7 @@ const UI = {
         UI.rfb.clipViewport = UI.getSetting('view_clip');
         UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale';
         UI.rfb.resizeSession = UI.getSetting('resize') === 'remote';
+        UI.rfb.qualityLevel = parseInt(UI.getSetting('quality'));
         UI.rfb.showDotCursor = UI.getSetting('show_dot');
 
         UI.updateViewOnly(); // requires UI.rfb
@@ -1324,6 +1329,18 @@ const UI = {
 /* ------^-------
  *   /VIEWDRAG
  * ==============
+ *    QUALITY
+ * ------v------*/
+
+    updateQuality() {
+        if (!UI.rfb) return;
+
+        UI.rfb.qualityLevel = parseInt(UI.getSetting('quality'));
+    },
+
+/* ------^-------
+ *   /QUALITY
+ * ==============
  *    KEYBOARD
  * ------v------*/
 
index 5399b48ba76ca7af854423d0c2453a811137440d..3f85f4b33d3bb271cedf744112c61a3310705f97 100644 (file)
@@ -61,6 +61,8 @@ query string. Currently the following options are available:
 * `resize` - How to resize the remote session if it is not the same size as
   the browser window. Can be one of `off`, `scale` and `remote`.
 
+* `quality` - The session JPEG quality level. Can be `0` to `9`.
+
 * `show_dot` - If a dot cursor should be shown when the remote server provides
   no local cursor, or provides a fully-transparent (invisible) cursor.
 
index ef7150c8ce4b755f0fcb83eb0006a9c26122ee7c..1bc884403798f70fe184bb18bb168aecb9d9f65f 100644 (file)
--- a/vnc.html
+++ b/vnc.html
                     <li>
                         <div class="noVNC_expander">Advanced</div>
                         <div><ul>
+                            <li>
+                                <label for="noVNC_setting_quality">Quality:</label>
+                                <input id="noVNC_setting_quality" type="range" min="0" max="9" value="">
+                            </li>
+                            <li><hr></li>
                             <li>
                                 <label for="noVNC_setting_repeaterID">Repeater ID:</label>
                                 <input id="noVNC_setting_repeaterID" type="text" value="">