ng-camera icon indicating copy to clipboard operation
ng-camera copied to clipboard

Webcam is not defined

Open atif opened this issue 10 years ago • 3 comments

Getting the following error when trying to use this library with AngularJS front-end

ReferenceError: Webcam is not defined at o (http://localhost:3000/public/client/myapp/main.js:13705:457) at http://localhost:3000/public/client/common/vendor.js:45:1323 at ne (http://localhost:3000/public/client/common/vendor.js:45:1380) at _ (http://localhost:3000/public/client/common/vendor.js:44:27893) at s (http://localhost:3000/public/client/common/vendor.js:44:23955) at _ (http://localhost:3000/public/client/common/vendor.js:44:27842) at http://localhost:3000/public/client/common/vendor.js:44:31387 at http://localhost:3000/public/client/common/vendor.js:45:22614 at p.e.$get.p.$eval (http://localhost:3000/public/client/common/vendor.js:45:29824) at p.e.$get.p.$digest (http://localhost:3000/public/client/common/vendor.js:45:28397)

Any ideas?

-- A

atif avatar Oct 14 '15 12:10 atif

Hi @atif, You have to import script webcam.js. You should have it in your bower dependencies because it's required for ng-camera.

<script src="/path/to/webcam.js"></script>

bcabanes avatar Oct 16 '15 00:10 bcabanes

@bcabanes : I have included both webcam, and ng-camera in bower dependencies. Still getting above error

atif avatar Oct 26 '15 12:10 atif

Had the save issue when loading it in Electron. Include it as follow:

<script type="text/javascript" src="vendors/webcamjs/webcam.min.js" onload="window.Webcam = module.exports;"></script>

phzietsman avatar Aug 06 '17 14:08 phzietsman