{"_id":"@capitalhitelhaz/cordova-plugin-canvascamera","_rev":"2-f38f0378f209418f9b01a09a99de6f8b","name":"@capitalhitelhaz/cordova-plugin-canvascamera","dist-tags":{"latest":"1.1.9"},"versions":{"1.1.8":{"name":"@capitalhitelhaz/cordova-plugin-canvascamera","version":"1.1.8","description":"A Cordova plugin to display video from the device's camera into an HTML canvas element.","repository":{"type":"git","url":"git+https://github.com/capitalhitelhaz/CanvasCameraPlugin.git"},"cordova":{"id":"com.virtuoworks.cordova-plugin-canvascamera","platforms":["android","ios"]},"keywords":["ecosystem:cordova","cordova-android","cordova-ios","cordova","camera","canvas"],"contributors":[{"name":"Virtuoworks","url":"https://www.virtuoworks.com/"},{"name":"Sami Radi","email":"sami.radi@virtuoworks.com","url":"https://github.com/Sami-Radi"},{"name":"Sébastien Guillon","email":"sebastien.guillon@virtuoworks.com","url":"https://github.com/Sebastien-Guillon"}],"engines":{"cordovaDependencies":{"3.0.0":{"cordova":">100"}}},"license":"MIT","gitHead":"9d21f0dae9843affc00e884dda9fac77341a59d6","bugs":{"url":"https://github.com/capitalhitelhaz/CanvasCameraPlugin/issues"},"homepage":"https://github.com/capitalhitelhaz/CanvasCameraPlugin#readme","_id":"@capitalhitelhaz/cordova-plugin-canvascamera@1.1.8","_nodeVersion":"10.14.1","_npmVersion":"6.10.0","dist":{"integrity":"sha512-TKo1Y7J0poKXxZmsyXiZvalDm1Xn7tgZBqwmZcK1IvmDpXg3d44hw7z1nMeRlBPz1lhc1giHfIg4ocuECsDN3A==","shasum":"3c06e9c995958167ca6dda150957bedad632743e","tarball":"https://registry.npmjs.org/@capitalhitelhaz/cordova-plugin-canvascamera/-/cordova-plugin-canvascamera-1.1.8.tgz","fileCount":9,"unpackedSize":149822,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHwpFCRA9TVsSAnZWagAAxjwP/iDRM5FOeoa8Kx67T/HY\nXKIn5n9pRYCsPEvIAmY1pYHDt/8gpv46v6tdK8xzH3pvLjw1HuNg57aFMhVt\nIHtwU5N77Dlnja5KcBYAcvoY60t3YkFvE6vSRJcJ7DrT0dsHp0q4EoMgmgBM\neZ1IY/BbSYVdCls9faT9Zr0R6mXLcXa10m88F2gajGiFD4kG5PH/n1e8pkG9\n4sQOjwTIavAyayeMiFLMCMl88PbbKtdRQuGnwM3O/Huor4tuA+W1Bcwqs7Rp\nfSovb5mXXzkGSkH7ovsUleBLFjCcwlV3YnDVBFYFErxCt3clVDhAuHfZoN49\n+ZVhTyXsfqMS3wkZ3Z3fPG1QLJbq2ZN+Pe+zAFwaMY900Bl8GhDFlLBuwwnA\nkBzr4QFh+Vu4HimhBtm/GpsXdbrawCztSwbNv7pr4pwXT2K2JYanSd06/aiJ\ntBZ0MtGyZyoooLLUFA5aqGyJLos+O42v1OFQQ2h0Ik9SrsCzep6MFqCTjLfU\njPHhswuKZh7w1ojUnRKlB2AgBULFZQzKdud5EKwu2PFgas00fi5DX23LLV2y\nV/NI62wok1oWVhKpREurqpuWHfOugsxeWsTmshzZXuT+D/JTfcrK7oIbhPFS\nUc72vymRj/3FjUxMihEzi429jZKXu1VRuwkFg+PbOeacmmFZ8x6PwqbgZtuP\n8E6O\r\n=CBP1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGUU27njZ6uXXW9/45LdTSsrRfDSiOcLsf/+xTkxHFWbAiAZEDpjy4QVfVGu4/wtM85Ns9htWxLHtx7aLe33mVMR0Q=="}]},"maintainers":[{"name":"petrot","email":"petro.tamas@gmail.com"},{"name":"molnarzs","email":"zsolt@zsoltmolnar.hu"}],"_npmUser":{"name":"petrot","email":"petro.tamas@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cordova-plugin-canvascamera_1.1.8_1562315332368_0.33077084182205607"},"_hasShrinkwrap":false},"1.1.9":{"name":"@capitalhitelhaz/cordova-plugin-canvascamera","version":"1.1.9","description":"A Cordova plugin to display video from the device's camera into an HTML canvas element.","repository":{"type":"git","url":"git+https://github.com/capitalhitelhaz/CanvasCameraPlugin.git"},"cordova":{"id":"com.virtuoworks.cordova-plugin-canvascamera","platforms":["android","ios"]},"keywords":["ecosystem:cordova","cordova-android","cordova-ios","cordova","camera","canvas"],"contributors":[{"name":"Virtuoworks","url":"https://www.virtuoworks.com/"},{"name":"Sami Radi","email":"sami.radi@virtuoworks.com","url":"https://github.com/Sami-Radi"},{"name":"Sébastien Guillon","email":"sebastien.guillon@virtuoworks.com","url":"https://github.com/Sebastien-Guillon"}],"engines":{"cordovaDependencies":{"3.0.0":{"cordova":">100"}}},"license":"MIT","gitHead":"c5de50d89b00521519be7051288ac2e4169328b1","bugs":{"url":"https://github.com/capitalhitelhaz/CanvasCameraPlugin/issues"},"homepage":"https://github.com/capitalhitelhaz/CanvasCameraPlugin#readme","_id":"@capitalhitelhaz/cordova-plugin-canvascamera@1.1.9","_nodeVersion":"10.14.1","_npmVersion":"6.10.0","dist":{"integrity":"sha512-Eplui0G8yYmR+Ei7qySTe1frB9PrARp6qk0Wc1zyv0/HsHSnsMehBKx/jawxMe8UXKNNG+lCfRxJR42Xf11FzA==","shasum":"9fd44b9b34606b47348a3a2109ff65afa2708eb9","tarball":"https://registry.npmjs.org/@capitalhitelhaz/cordova-plugin-canvascamera/-/cordova-plugin-canvascamera-1.1.9.tgz","fileCount":9,"unpackedSize":149907,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHw2jCRA9TVsSAnZWagAABPYQAIakmRfkcx+a7Cz0M54a\n5j9akjLwl5SrAzDv23emTsWvGfao0Om6xTMfAoJ8IfCrPmeyFkZkdHo0fNYx\nNXrAMnNFBb62MtK/wyee/Bxl0kT5mP80lmpoSll3U8xqAYdFbZQBtIR3d5Fw\nD/EHMmJY5HFMxruhGR1CvqW5bvmYmLWmzQtXxJZqIhqhK/XUEAJrIOOyBiQg\nMfQRoCxpzMa5kFAS5geogDbICBU7qhUA41MPNmN6AtLUAUFqgJPtFyegItKT\ncqNWOkbhd9a1vj3bFONAEQoe1w9WL8+vc51INHq4b+RaCKG60CfymsVdD6tB\n4LwAj2hJJJ7VTG6OnVkW0c7ZAxMAg7K4NpB7Ea2Jw1k1dHIO1EGypgVfCdjQ\nOOZuC4e///EJG5KsL+t9k9rqitJwDdh/1c2/ipBhXN7QOj5eKWi9I1OHDP6F\nVosCr1EQKF2avSMNQ5nX6uONKyw0Thxd2unmz1fNQuwC/1v8M/9kDYS3tDBp\naVQdJVKku/u/I2cMYM88+w/G8ti2cXMx06cl209P4qwfF4JEfU//j0obt/GC\ncNczYqPpAxXaFYb1PjGlrKcoiPw0BfiN4nqbkXCum4J89/q10qjLY1NUcsjn\ncRWNDxBfp9d7+pWZMSKoxJG8dzm3kgL1IfzIx5HUW6OhFEpbpFvgglQLQ9Nq\n8DJb\r\n=HqWG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcI/6aDvqCWrADFqxkgyci6t2tWANVE4nh6DXk1iX6pQIhAM9v2J0gHrXL1dAfIApfEfpX40BYlVk8bLzrCWXN055Q"}]},"maintainers":[{"name":"molnarzs","email":"zsolt@zsoltmolnar.hu"},{"name":"petrot","email":"petro.tamas@gmail.com"}],"_npmUser":{"name":"petrot","email":"petro.tamas@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cordova-plugin-canvascamera_1.1.9_1562316194460_0.8130877889847925"},"_hasShrinkwrap":false}},"time":{"created":"2019-07-05T08:28:52.157Z","1.1.8":"2019-07-05T08:28:52.479Z","modified":"2022-04-04T21:45:59.594Z","1.1.9":"2019-07-05T08:43:14.574Z"},"maintainers":[{"name":"molnarzs","email":"zsolt@zsoltmolnar.hu"},{"name":"petrot","email":"petro.tamas@gmail.com"}],"description":"A Cordova plugin to display video from the device's camera into an HTML canvas element.","homepage":"https://github.com/capitalhitelhaz/CanvasCameraPlugin#readme","keywords":["ecosystem:cordova","cordova-android","cordova-ios","cordova","camera","canvas"],"repository":{"type":"git","url":"git+https://github.com/capitalhitelhaz/CanvasCameraPlugin.git"},"contributors":[{"name":"Virtuoworks","url":"https://www.virtuoworks.com/"},{"name":"Sami Radi","email":"sami.radi@virtuoworks.com","url":"https://github.com/Sami-Radi"},{"name":"Sébastien Guillon","email":"sebastien.guillon@virtuoworks.com","url":"https://github.com/Sebastien-Guillon"}],"bugs":{"url":"https://github.com/capitalhitelhaz/CanvasCameraPlugin/issues"},"license":"MIT","readme":"[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Codacy Badge][codacy-image]][codacy-url]\n\n## TL;DR\n\n```\n# Bump version number in package.json\nnpm publish --access public\n```\n\n# Cordova CanvasCamera plugin\n\n## Plugin's Purpose\nThe purpose of the plugin is to capture video to preview camera in a web page's canvas element.\nAllows to select front or back camera and to control the flash.\n\n## Working Demo\nHaving trouble using CanvasCamera Plugin ? [Check our working demo here](https://github.com/VirtuoWorks/CanvasCameraDemo).\n\n## Supported Platforms\n- iOS\n- Android\n\n## Dependencies\n[Cordova][cordova] will check all dependencies and install them if they are missing.\n\n## Installation\nThe plugin can either be installed into the local development environment or cloud based through [PhoneGap Build][PGB].\n\n### Adding the Plugin to your project\nThrough the [Command-line Interface][CLI]:\n\n```bash\ncordova plugin add https://github.com/capitalhitelhaz/CanvasCameraPlugin.git && cordova prepare\n```\n\n### Removing the Plugin from your project\nThrough the [Command-line Interface][CLI]:\n\n```bash\ncordova plugin remove com.virtuoworks.cordova-plugin-canvascamera\n```\n\n## TypeScript/Angular 2 support\nThe CanvasCamera plugin type definition has been added to the DefinitelyTyped repository (see commit [here](https://github.com/DefinitelyTyped/DefinitelyTyped/commit/7f7f502db804112161ef06e712275591d8c4a835)) thanks to a benevolent [contributor](https://github.com/VirtuoWorks/CanvasCameraPlugin/issues/8).\n\nIf you wish to install the type definition file :\n\n```bash\nnpm install --save @types/cordova-plugin-canvascamera\n```\n\nYou can check this [NPM](https://www.npmjs.com/package/@types/cordova-plugin-canvascamera) page for more informations about this type definition.\n\n## Using the plugin (JavaScript)\nThe plugin creates the object ```window.plugin.CanvasCamera``` with the following methods:\n\n### Plugin initialization\nThe plugin and its methods are not available before the *deviceready* event has been fired.\nCall `initialize` with a reference to the canvas object used to preview the video and a second, optional, reference to a thumbnail canvas.\n\n```javascript\ndocument.addEventListener('deviceready', function () {\n\n    // Call the initialize() function with canvas element reference\n    var objCanvas = document.getElementById('canvas');\n    window.plugin.CanvasCamera.initialize(objCanvas);\n    // window.plugin.CanvasCamera is now available\n\n}, false);\n```\n\n### `start`\nStart capturing video as images from camera to preview camera on web page.<br>\n`capture` callback function will be called with image data (image file url) each time the plugin takes an image for a frame.<br>\n\n```javascript\nwindow.plugin.CanvasCamera.start(options);\n```\n\nThis function starts a video capturing session, then the plugin takes each frame as a JPEG image and gives its url to web page calling the `capture` callback function with the image url(s).<br>\nThe `capture` callback function will draw the image inside a canvas element to display the video.\n\n\n#### Example\n```javascript\nvar options = {\n    cameraFacing: 'front',\n};\nwindow.plugin.CanvasCamera.start(options);\n```\n### `flashMode`\nSet flash mode for camera.<br>\n\n```javascript\nwindow.plugin.CanvasCamera.flashMode(true);\n```\n\n### `cameraPosition`\nChange input camera to 'front' or 'back' camera.\n\n```javascript\nwindow.plugin.CanvasCamera.cameraPosition('front');\n```\n\n### Options\nOptional parameters to customize the settings.\n\n```javascript\n{\n    width: 352,\n    height: 288,\n    canvas: {\n      width: 352,\n      height: 288\n    },\n    capture: {\n      width: 352,\n      height: 288\n    },\n    fps: 30,\n    use: 'file',\n    flashMode: false,\n    thumbnailRatio: 1/6,\n    cameraFacing: 'front' // or 'back',\n    onBeforeDraw: function(frame){\n      // do something before drawing a frame\n      // frame.image; // HTMLImageElement\n      // frame.element; // HTMLCanvasElement\n    },\n    onAfterDraw: function(frame){\n      // do something after drawing a frame\n      // frame.image.src; // file path or base64 data URI\n      // frame.element.toDataURL(); // requested base64 data URI\n    }\n}\n\n```\n- `width` : **Number**, optional, default : `352`, width in pixels of the video to capture **and** the output canvas width in pixels.\n- `height` : **Number**, optional, default : `288`, height in pixels of the video to capture **and** the output canvas height in pixels.\n\n- `capture.width` : **Number**, optional, default : `352`, width in pixels of the video to capture.\n- `capture.height` : **Number**, optional, default : `288`, height in pixels of the video to capture.\n\n- `canvas.width` : **Number**, optional, default : `352`, output canvas width in pixels.\n- `canvas.height` : **Number**, optional, default : `288`, output canvas height in pixels.\n\n- `fps` : **Number**, optional, default : `30`, desired number of frames per second.\n- `cameraFacing` : **String**, optional, default : `'front'`, `'front'` or `'back'`.\n- `flashMode` : **Boolean**, optional, default : `false`, a boolean to set flash mode on/off.\n- `thumbnailRatio` : **Number**, optional, default : `1/6`, a ratio used to scale down the thumbnail.\n\n- `use` : **String**, optional, default : `file`, `file` to use files for rendering (lower CPU / higher storage) or `data` to use base64 jpg data for rendering (higher cpu / lower storage).\n\n- `onBeforeDraw` : **Function**, optional, default : `null`, callback executed before a frame has been drawn. `frame` contains the canvas element, the image element, the tracking data, ...\n- `onAfterDraw` : **Function**, optional, default : `null`,  callback executed after a frame has been drawn. `frame` contains the canvas element, the image element, the tracking data, ...\n\n## Usage\n\n### Full size video only\n```javascript\nlet fullsizeCanvasElement = document.getElementById('fullsize-canvas');\n\nCanvasCamera.initialize(fullsizeCanvasElement);\n\nlet options:CanvasCamera.CanvasCameraOptions = {\n    cameraFacing: 'back',\n    onAfterDraw: function(frame) {\n      // do something with each frame\n      // frame.image.src; // file path or base64 data URI\n      // frame.element.toDataURL(); // requested base64 data URI\n    }\n};\n\nCanvasCamera.start(options);\n```\n\n### With thumbnail video\n```javascript\nlet fullsizeCanvasElement = document.getElementById('fullsize-canvas');\nlet thumbnailCanvasElement = document.getElementById('thumbnail-canvas');\n\nCanvasCamera.initialize(fullsizeCanvasElement, thumbnailCanvasElement);\n\nlet options:CanvasCamera.CanvasCameraOptions = {\n    cameraFacing: 'front',\n    fps: 15,\n    thumbnailRatio: 1/6,\n    onAfterDraw: function(frame) {\n      // do something with each frame of the fullsize canvas element only\n      // frame.image.src; // file path or base64 data URI\n      // frame.element.toDataURL(); // requested base64 data URI\n    }\n};\n\nCanvasCamera.start(options);\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## License\n\nThis software is released under the [MIT License][mit-license].\n\n[cordova]: https://cordova.apache.org\n[PGB]: http://docs.phonegap.com/phonegap-build/\n[CLI]: http://cordova.apache.org/docs/en/latest/guide/cli/index.html\n[mit-license]: https://opensource.org/licenses/MIT\n[npm-image]: https://img.shields.io/npm/v/com.virtuoworks.cordova-plugin-canvascamera.svg\n[npm-url]: https://www.npmjs.com/package/com.virtuoworks.cordova-plugin-canvascamera\n[downloads-image]: https://img.shields.io/npm/dm/com.virtuoworks.cordova-plugin-canvascamera.svg\n[downloads-url]: https://www.npmjs.com/package/com.virtuoworks.cordova-plugin-canvascamera\n[codacy-image]: https://api.codacy.com/project/badge/Grade/dcccd741d63d4b0ea51ae3ccb2cd7d89\n[codacy-url]: https://www.codacy.com/app/VirtuoWorks/CanvasCameraPlugin?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=VirtuoWorks/CanvasCameraPlugin&amp;utm_campaign=Badge_Grade\n","readmeFilename":"README.md"}