在Android中显示html内的摄像机视图,然后拍摄图片 [英] Showing camera view inside html in android and then snap a picture

查看:193
本文介绍了在Android中显示html内的摄像机视图,然后拍摄图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用JavaScript捕捉图片之前,是否有在html(例如嵌入div)中显示实时相机视图的视图?我试过PhoneGap,但它完全开始一个新的相机应用程序,完全离开我的HTML网络应用程序,然后再返回它。我需要嵌入我的应用程序中的东西

Is there a view of showing the live camera view inside html ( e.g. embedded in a div ) before we snap a picture using JavaScript? I have tried PhoneGap but it totally starts a new camera app and totally moves away from my html web app before returning to it. I need something embedded in my app

感谢

推荐答案

在您的Cordova / phonegap应用程序中安装允许相机交互的 mbppower / CordovaCameraPreview 插件(适用于android,ios)从HTML代码。一个真正惊人的插件它是..
您可以访问的功能,如:

You can install mbppower/CordovaCameraPreview plugin (for android,ios) in your Cordova/phonegap application that allows camera interaction from HTML code. A really amazing plugin it is.. You can access Features such as:

从HTML代码启动相机预览。
拖动预览框。
设置相机颜色效果(Android和iOS),将预览框发送回HTML内容的背面,为相机预览框设置自定义位置,为预览框设置自定义尺寸,并保持HTML交互性。 strong>

Start a camera preview from HTML code. Drag the preview box. Set camera color effect (Android and iOS),Send the preview box to back of the HTML content,Set a custom position for the camera preview box,Set a custom size for the preview box and Maintain HTML interactivity.

或者您也可以使用 donaldp24 / CanvasCamera 插件适用于您的应用程序。它适用于Android和iOS平台。我已经观察到,对于iOS它的工作正常,但在Android它不工作。

Or you can also use donaldp24/CanvasCamera Plugin for your application if it fits to your requirements.Its supported in both android and iOS platforms. I have observed, for iOS its working fine but in android it isn't working.

现在你可以通过在线PhoneGap安装CordovaCameraPreview插件。所以不使用CLI,你可以直接使用它通过添加

Now you can install CordovaCameraPreview plugin through Online PhoneGap too. So without using CLI you can directly use it through this by adding

< gap:plugin name =com.mbppower.camerapreviewversion =在您的config.xml文件中创建0.0.8source =plugins.cordova.io/>

并创建ApplicationTemplate.apk /.ipa。有关这方面的更多信息,你可以问我。乐于帮助。

in your config.xml file and create ApplicationTemplate.apk/.ipa. For more information regarding this you can ask me. Happy to help.

这篇关于在Android中显示html内的摄像机视图,然后拍摄图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆