Ionic Camera Preview with auto capture when focus

Any idea how to develop ionic app that turn on camera preview and whener camera focus to object properly, It will capture image automatically.

Regards.