Fix to be usable to firefox
- Firefox can only detect lower resolution capability of camera, adding the min resolution in the camera constraints enables it to work in firefox
This commit is contained in:
Vendored
+4
-3
@@ -95,7 +95,6 @@ function marhunPhotoCapturerFactory(modal_selector) {
|
|||||||
|
|
||||||
let enumerateDevices = () => navigator.mediaDevices.enumerateDevices()
|
let enumerateDevices = () => navigator.mediaDevices.enumerateDevices()
|
||||||
.then(devices => devices.filter(x => x.kind === 'videoinput'))
|
.then(devices => devices.filter(x => x.kind === 'videoinput'))
|
||||||
.then(x => {console.log; return x;});
|
|
||||||
getUserMedia();
|
getUserMedia();
|
||||||
|
|
||||||
|
|
||||||
@@ -159,8 +158,9 @@ function marhunPhotoCapturerFactory(modal_selector) {
|
|||||||
function composeConstraint(camera) {
|
function composeConstraint(camera) {
|
||||||
|
|
||||||
let constraints = {
|
let constraints = {
|
||||||
width: { exact: 3200 },
|
width: { min: 1280, max: 3200 },
|
||||||
height: { exact: 1800 },
|
height: { min: 720, max: 1800 },
|
||||||
|
aspectRatio: {exact: 1.7777777778},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (camera.deviceId !== '') {
|
if (camera.deviceId !== '') {
|
||||||
@@ -198,6 +198,7 @@ function marhunPhotoCapturerFactory(modal_selector) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function streamCameraView(stream) {
|
function streamCameraView(stream) {
|
||||||
|
console.log(stream.getVideoTracks()[0].getSettings())
|
||||||
let modal = document.querySelector(modal_selector);
|
let modal = document.querySelector(modal_selector);
|
||||||
let videoTagPreview = modal.querySelector('.video-tag-overallmarhun.video-preview');
|
let videoTagPreview = modal.querySelector('.video-tag-overallmarhun.video-preview');
|
||||||
let videoTagData = modal.querySelector('.video-tag-overallmarhun.video-data');
|
let videoTagData = modal.querySelector('.video-tag-overallmarhun.video-data');
|
||||||
|
|||||||
Reference in New Issue
Block a user