Skip to content

Commit

Permalink
tweaks to video constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
justinhunt committed Feb 28, 2022
1 parent 6e05f3c commit 709c428
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions amd/src/poodll_mediarecorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,10 @@ define(['jquery', 'core/log', 'filter_poodll/utils_amd',
fetch_video_constraints: function (ip) {
var mediaConstraints = {
audio: !utils.is_opera() && !utils.is_edge(),
video: true
video: {
width: {ideal: 640},
height: {ideal: 480}
}
};

//set aspect ratio and I think the "exact" below should be "ideal"
Expand All @@ -527,15 +530,16 @@ define(['jquery', 'core/log', 'filter_poodll/utils_amd',
// check for a user video selected device
if (ip.uservideodeviceid) {
var videodeviceid = ip.uservideodeviceid.valueOf();
var constraints = {deviceId: videodeviceid ? {exact: videodeviceid} : undefined};

mediaConstraints.video = constraints;
var videoconstraints = {deviceId: videodeviceid ? {exact: videodeviceid} : undefined};
videoconstraints.width={ideal: 640};
videoconstraints.height={ideal: 480};
mediaConstraints.video = videoconstraints;
}
// check for a user audio selected device
if (ip.useraudiodeviceid) {
var audiodeviceid = ip.useraudiodeviceid.valueOf();
var constraints = {deviceId: audiodeviceid ? {exact: audiodeviceid} : undefined};
mediaConstraints.audio = constraints;
var audioconstraints = {deviceId: audiodeviceid ? {exact: audiodeviceid} : undefined};
mediaConstraints.audio = audioconstraints;
}
return mediaConstraints;
},
Expand Down

0 comments on commit 709c428

Please sign in to comment.