From 5243cbf61107507ee221e4848aeb412553acb3a2 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 28 Feb 2020 14:52:56 +0100 Subject: [PATCH] Add UI for quality setting --- app/ui.js | 17 +++++++++++++++++ docs/EMBEDDING.md | 2 ++ vnc.html | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/app/ui.js b/app/ui.js index 0268f46..d118c84 100644 --- 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------*/ diff --git a/docs/EMBEDDING.md b/docs/EMBEDDING.md index 5399b48..3f85f4b 100644 --- a/docs/EMBEDDING.md +++ b/docs/EMBEDDING.md @@ -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. diff --git a/vnc.html b/vnc.html index ef7150c..1bc8844 100644 --- a/vnc.html +++ b/vnc.html @@ -207,6 +207,11 @@
  • Advanced
      +
    • + + +
    • +

    • -- 2.39.2