Webcam.set({
    // live preview size
    width: 300,
    height: 300,
    // device capture size
    dest_width: 300,
    dest_height: 300,
    // final cropped size
    crop_width: 300,
    crop_height: 300,
    image_format: 'jpeg',
    jpeg_quality: 90
});
function setup() {
    Webcam.reset();
    Webcam.set('constraints',{facingMode: "environment"});
    Webcam.attach('#user_foto_frame');
}
function take_snapshot() {
    // take snapshot and get image data
    Webcam.snap(function (data_uri) {
        // display results in page
        document.getElementById('user_foto_frameWebCam').innerHTML = '<img src="' + data_uri + '"/>';
        
        $("textarea[name='fotoWebcam']").val(data_uri);
    });
}
