diff options
Diffstat (limited to 'client-web/source/preferences')
-rw-r--r-- | client-web/source/preferences/decl.ts | 8 | ||||
-rw-r--r-- | client-web/source/preferences/mod.ts | 2 | ||||
-rw-r--r-- | client-web/source/preferences/ui.ts | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/client-web/source/preferences/decl.ts b/client-web/source/preferences/decl.ts index 7d5c8b6..536c5c7 100644 --- a/client-web/source/preferences/decl.ts +++ b/client-web/source/preferences/decl.ts @@ -19,7 +19,7 @@ const optional = <T>(a: T): T | undefined => a export const PREF_DECLS = { username: { type: string, default: "guest-" + hex_id(), allow_url: true }, language: { type: string, possible_values: ["system", ...Object.keys(LOCALES)], default: "system", allow_url: true }, - + /* MEDIA */ rnnoise: { type: bool, default: true, allow_url: true }, native_noise_suppression: { type: bool, default: false }, @@ -35,7 +35,11 @@ export const PREF_DECLS = { microphone_enabled: { type: bool, default: false }, screencast_enabled: { type: bool, default: false }, camera_enabled: { type: bool, default: false }, - + send_previews: { type: bool, default: true }, + preview_resolution: { type: number, default: 256, min: 16, max: 512 }, + preview_rate: { type: number, default: 8, min: 1, max: 60 }, + preview_encoding_quality: { type: number, default: 80, min: 10, max: 100 }, + // TODO differenciate between mic, cam and screen optional_audio_default_enable: { type: bool, default: true }, optional_video_default_enable: { type: bool, default: false }, diff --git a/client-web/source/preferences/mod.ts b/client-web/source/preferences/mod.ts index 1df57b1..bbf9bfb 100644 --- a/client-web/source/preferences/mod.ts +++ b/client-web/source/preferences/mod.ts @@ -15,6 +15,8 @@ export interface PrefDecl<T> { hidden?: boolean allow_url?: boolean require_reload?: boolean, + min?: number, + max?: number, } type Type = "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"; diff --git a/client-web/source/preferences/ui.ts b/client-web/source/preferences/ui.ts index 9cb52fd..c710f54 100644 --- a/client-web/source/preferences/ui.ts +++ b/client-web/source/preferences/ui.ts @@ -57,6 +57,8 @@ export function ui_preferences(): HTMLElement { textbox.type = "number" textbox.id = id textbox.value = PREFS[key] as string + if (decl.min) textbox.min = "" + decl.min + if (decl.max) textbox.max = "" + decl.max textbox.onchange = () => { change_pref(key, parseFloat(textbox.value)) } |