donaldp24 / CanvasCameraPlugin

Phonegap CanvasCameraPlugin
107 stars 119 forks source link

Not working with Meteor JS #26

Open cmboros opened 9 years ago

cmboros commented 9 years ago

Hello,

Im using Meteor and Cordova and i try to use this plugin but have some issue. The camera feed don't display in canvas but i can take picture switch the camera use the flash option but is not displaying the camera feed. I have setup also a standalone cordova app using the plugin and is working.

I have attach the image one from meteor and one from cordova.

img_0327 img_0328

Anyone have any idea why is working like this?

Thanks

brightline commented 9 years ago

We just integrated this with Meteor. The issue is that the image files are being loaded into the canvas with a file:// path. Unfortunately Meteor files are all loaded from http://meteor.local, so you end up with a CORS error. On iOS, you can work around this by overriding the capture method and parsing provided file URL to use a cdvfile://persistent/tmp/ url instead. If you're using WKWebView, though, the cdvfile solution does not work, and you will probably need to load the file to a dataURL using the cordova file plugin.