Set the max camera resolution before commencing video streaming cont'd

This commit is contained in:
afiq.hamzah
2023-05-23 13:44:53 +08:00
parent b88af639da
commit df8455a857
4 changed files with 10 additions and 9 deletions
+5 -4
View File
@@ -18,12 +18,13 @@ function marhunPhotoCapturerFactory(modal_selector) {
let canvas = document.createElement('canvas');
let captureImage = () => {
let videoTag = modal.querySelector('.video-tag-overallmarhun.video-data');
return new Promise(function (resolve, reject) {
try {
let modal = document.querySelector(modal_selector);
let videoTag = modal.querySelector('.video-tag-overallmarhun.video-data');
canvas.width = 1920;
canvas.height = 1080;
canvas.width = 3200;
canvas.height = 1800;
canvas.getContext("2d").drawImage(videoTag, 0, 0, canvas.width, canvas.height)
resolve(canvas);
} catch (error) {
@@ -160,8 +161,8 @@ function marhunPhotoCapturerFactory(modal_selector) {
function composeConstraint(camera) {
let constraints = {
width: { exact: 3200 },
height: { exact: 1800 },
width: { exact: 1920 },
height: { exact: 1080 },
};
if (camera.deviceId !== '') {