Commit 2ad6fc5b authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Constrain video aspect ratio rather than resolution.

parent ff28e33d
...@@ -1391,7 +1391,9 @@ function replaceCameraStream() { ...@@ -1391,7 +1391,9 @@ function replaceCameraStream() {
async function addLocalMedia(localId) { async function addLocalMedia(localId) {
let settings = getSettings(); let settings = getSettings();
/** @type{boolean|MediaTrackConstraints} */
let audio = settings.audio ? {deviceId: settings.audio} : false; let audio = settings.audio ? {deviceId: settings.audio} : false;
/** @type{boolean|MediaTrackConstraints} */
let video = settings.video ? {deviceId: settings.video} : false; let video = settings.video ? {deviceId: settings.video} : false;
if(video) { if(video) {
...@@ -1403,8 +1405,7 @@ async function addLocalMedia(localId) { ...@@ -1403,8 +1405,7 @@ async function addLocalMedia(localId) {
video.width = { min: 640, ideal: 1920 }; video.width = { min: 640, ideal: 1920 };
video.height = { min: 400, ideal: 1080 }; video.height = { min: 400, ideal: 1080 };
} else { } else {
video.width = { ideal: 640 }; video.aspectRatio = { ideal: 4/3 };
video.height = { ideal: 400 };
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment