Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello Everyone,
I was trying to capture image using webcam in mvc 4 razor, i was able to capture same using jquery but having some problem in using that.
my code is below:
JavaScript
<script type="text/javascript">
    $(".clsCam").click(function (e) {

        webcam.set_api_url('@Url.Action("CapturePhoto", "DataExport")');
        webcam.set_swf_url('@Url.Content("~/Scripts/jpegcam/htdocs/webcam.swf")');
        webcam.set_quality(100); 
        webcam.set_shutter_sound(false, '@Url.Content("~/Scripts/jpegcam/htdocs/shutter.mp3")');
        webcam.set_hook('onComplete', 'upload_complete');

        document.write(webcam.get_html(200, 150));

        function upload() {
            webcam.freeze(); 
            webcam.upload();  
        }
        function upload_complete(response) {
            var json = jsonParse(response);
            if (json.Redirect) {
                window.location.replace(json.Redirect);
            } else if (json.Error) {
                Notifier.Error('Error', json.Error.Message);
                webcam.reset();
            } else {
                Notifier.Error('Error', 'An unknown error has occurred.');
                webcam.reset();
            }
        }
    });
</script>

but m not able to fix that webcam screen in my frame/div where i need.
Is there any other way to capture image in mvc 4 razor which can be customized as per my need.

thanking you.
Posted

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900