Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iphone open device camera instead of web camera #320

Open
mkakadiya47 opened this issue Dec 10, 2020 · 0 comments
Open

Iphone open device camera instead of web camera #320

mkakadiya47 opened this issue Dec 10, 2020 · 0 comments

Comments

@mkakadiya47
Copy link

Here is code, its now working properly on iphone, device open instead of web camera, anyone can help me?

Webcam.set({
width: 150,
height: 150,
dest_width: 640,
dest_height: 480,
image_format: 'jpeg',
jpeg_quality: 90,
});

Webcam.attach( '#my_camera' );
var shutter = new Audio();
shutter.autoplay = true;
function take_snapshot() {
    var take = $(".snap").data('val');
    shutter.src = '/public/assets/sounds/shutter.mp3';
    Webcam.snap( function(data_uri) {
        $(".image-tag").val(data_uri);
    });
    Webcam.freeze();
    $(".snap").html('');

    $("#exampleModalPreview").modal('toggle');
}

Webcam.on( 'error', function(err) {
    shutter.src = '/public/assets/sounds/error.mp3';
    shutter.play();
    $(".snap").data('val', "error");
});
Webcam.on( 'load', function(err) {
    $(".snap").data('val', "take");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant