diff --git a/shared/js/connection/rtc/Connection.ts b/shared/js/connection/rtc/Connection.ts index 5ff6f4fb..53fc1179 100644 --- a/shared/js/connection/rtc/Connection.ts +++ b/shared/js/connection/rtc/Connection.ts @@ -541,6 +541,8 @@ export class RTCConnection { this.reset(true); this.connection.events.on("notify_connection_state_changed", event => this.handleConnectionStateChanged(event)); + + (window as any).rtp = this; } destroy() { diff --git a/shared/js/media/Video.ts b/shared/js/media/Video.ts index 670a4cf0..b041c5aa 100644 --- a/shared/js/media/Video.ts +++ b/shared/js/media/Video.ts @@ -248,9 +248,9 @@ export class WebVideoSource implements VideoSource { private readonly deviceId: string; private readonly displayName: string; private readonly stream: MediaStream; + private readonly initialSettings: VideoSourceInitialSettings; private referenceCount = 1; - private initialSettings: VideoSourceInitialSettings; constructor(deviceId: string, displayName: string, stream: MediaStream) { this.deviceId = deviceId; @@ -291,13 +291,13 @@ export class WebVideoSource implements VideoSource { return { minWidth: capabilities?.width?.min || 1, - maxWidth: capabilities?.width?.max || this.initialSettings.width, + maxWidth: capabilities?.width?.max || this.initialSettings.width || undefined, minHeight: capabilities?.height?.min || 1, - maxHeight: capabilities?.height?.max || this.initialSettings.height, + maxHeight: capabilities?.height?.max || this.initialSettings.height || undefined, minFrameRate: capabilities?.frameRate?.min || 1, - maxFrameRate: capabilities?.frameRate?.max || this.initialSettings.frameRate + maxFrameRate: capabilities?.frameRate?.max || this.initialSettings.frameRate || undefined }; } diff --git a/shared/js/settings.ts b/shared/js/settings.ts index fad2ab63..608baa8e 100644 --- a/shared/js/settings.ts +++ b/shared/js/settings.ts @@ -644,6 +644,20 @@ export class Settings { valueType: "number", }; + static readonly KEY_VIDEO_DEFAULT_MAX_BANDWIDTH: ValuedRegistryKey = { + key: "video_default_max_bandwidth", + defaultValue: 1_600_000, + description: "The default video bandwidth to use in bits/seconds.\nA too high value might not be allowed by all server permissions.", + valueType: "number", + }; + + static readonly KEY_VIDEO_DEFAULT_KEYFRAME_INTERVAL: ValuedRegistryKey = { + key: "video_default_keyframe_interval", + defaultValue: 0, + description: "The default interval to forcibly request a keyframe from ourself in seconds. A value of zero means no such interval.", + valueType: "number", + }; + static readonly KEY_VIDEO_DYNAMIC_QUALITY: ValuedRegistryKey = { key: "video_dynamic_quality", defaultValue: true, diff --git a/shared/js/ui/modal/video-source/Controller.tsx b/shared/js/ui/modal/video-source/Controller.tsx index 4d06f5c8..1c929cf9 100644 --- a/shared/js/ui/modal/video-source/Controller.tsx +++ b/shared/js/ui/modal/video-source/Controller.tsx @@ -128,13 +128,20 @@ async function generateAndApplyDefaultConfig(source: VideoSource) : Promise