danielebogo / DBCamera

DBCamera is a simple custom camera with AVFoundation
MIT License
1.26k stars 262 forks source link

Cordova Plugin #23

Open mkcode opened 10 years ago

mkcode commented 10 years ago

Hi @danielebogo

I created an Apache Cordova wrapper for this project here: https://github.com/vulume/Cordova-DBCamera

Please check it out and let me know what you think. Contributions are more than welcome. Let me know if I can better accredit your work anywhere as well. Cheers

mkcode commented 10 years ago

Quick instructions to play around with this:

   npm install -g cordova
   git clone https://github.com/vulume/Cordova-DBCamera
   cordova create dbcamera-test
   cd dbcamera-test
   cordova platform add iOS
   cordova plugin add ../Cordova-DBCamera
   open platforms/ios/*.xcodeproj
danielebogo commented 10 years ago

Hi @mkcode , sorry for my delay. Your work is awesome. I'm very happy. I hope to finish the new release asap with a refactor on many classes and many bug fixes. Specially a little documentation on all API. Thanks again and let me know what you think about new changes.

Daniele

mkcode commented 10 years ago

Sounds great. Btw - I evaluated every IOS camera related cocoapod before deciding that dbcamera was the best so thank you for creating this.

Looking forward to see what changes in the upcoming release. There are a few changes I will make shortly to the cordova plugin, mainly using an already compiled .a file instead of source files - will avoid having to set the gnu99 dialect. Will do this when I pull in the next release.

Also, I was forced to temporarily disable passing the metadata back to the JS callback. Cordova JSONSerializes the metadata NSdictionary - but it breaks on iPhone5Ss. It looks like the 5S and the 5 send back different metadata - and I don't have a 5S to debug this on. I'd like to look into this more some point soon.

Cheers

danielebogo commented 10 years ago

Thanks a lot @mkcode. You can take a look to the master, for a preview. I'll just add a few small changes and more precise documentation.

mkcode commented 10 years ago

Lot's of good changes. The new image cropping bounds are exactly what I wanted.

Look's like I'll need to update the Container related code in the plugin. I spent some time yesterday working on a update script that makes the plugin from the cocoapod spec, with compiling the source for the plugin. Hopefully, it won't be just me who is will update the project. I'll get this out this week.

danielebogo commented 10 years ago

I've done a name refactoring; all the controllers have ViewController suffix. This is because i've created a custom settings of alloc option (in the Profiler) to check if the app has some retain cycle. And fortunately it's ok. No retain cycles ;)

danielebogo commented 10 years ago

The completion block within the container, handles the cameraView. This avoid the init of the cameraViewController in the init method of the container (solution for a old pull request i've accepted). In the block you can change the properties values of the cameraView.

mkcode commented 10 years ago

Plugin is working nicely at version 2.0 :-)

I ended up making this repo to manage updating https://github.com/mkcode/cocoapod-to-cordova

danielebogo commented 10 years ago

Great! I've merged the pull request!

danielebogo commented 10 years ago

Hi @mkcode , i've done a little change... take a look to this commit bc9a3fcbb056dd3d765005821d080a9f4f1f7080. I've moved the DBCameraGridView (thinking about a custom grid view implementation) to a public property. Only this.

mkcode commented 9 years ago

Thanks for the update. The cordova plugin is up to date with this change. The default grid view is perfect for my use case, but adding a way to easily customize this is a great change.

I'm considering the best way to handle locking the orientation to portrait. I did this in the cordova plugin: https://github.com/vulume/Cordova-DBCamera/compare/34d7a40...9e8625b

This forces portrait mode for the lifetime of the NavController, but I questioned when I implemented this if should add this to the individual ViewControllers and submit a PR to this project. Currently - the views don't support landscape, so perhaps they should be locked into portrait mode in each ViewController - then they could be updated on an individual basis if they do support landscape in the future. I'm also not sure of the best practice for this - to lock the orientation in the NavController or the ViewControllers.

danielebogo commented 9 years ago

Hi @mkcode , i've updated the library with different bug fixes and pull requests. Take a look ok?

Ekta410 commented 9 years ago

Thank you so much. You both @mkcode , @danielebogo have done really a great work. Can you please help me out regarding how to use these plugins in DevExpress ? As my application works on DevExpress + AngularJS + Cordova, and I want to access camera properties like Grids, Tilt Angle, orientation. Please help me out.

mrameezraja commented 8 years ago

@danielebogo thanks for creating such a great plugin. Can you guys please tell me how can i add a label in place of grid button? I want to show a category title in place of grid button. Objective-C is not not my thing. I am a javascript developer.

Any help would be highly appreciated.

dalmendray commented 8 years ago

Hi @mkcode,

I would like to use your plugin via build.phonegap. What do I have to write in the config.xml file to install your plugin through the phonegap build website?

Thanks

mkcode commented 8 years ago

@dalmendray - the plugin title is com.vulume.cordova.dbcamera. Hopefully you get it by referencing that.

I no longer maintain this project. Feel to use it, but at your own risk.

mkcode commented 8 years ago

@danielebogo - Just a note, that I am no longer contributing to this project. Let me know if I can help transition this work in any way.