[英]How can I access my android smartphone's both front and rear camera through a web app?
I want to access my android smartphones both front and rear camera through a web app.我想通过网络应用访问我的安卓智能手机的前置和后置摄像头。 I came across a web app in Jsfiddle which I modified according to my need and was trying on my android phone to access my android front and rear camera but was unable to do.我在 Jsfiddle 中遇到了一个网络应用程序,我根据需要对其进行了修改,并尝试在我的 android 手机上访问我的 android 前后摄像头,但无法做到。
Please visit this web app at : https://jsfiddle.net/cf90az9q/19/请访问此网络应用程序: https : //jsfiddle.net/cf90az9q/19/
I am viewing this app from chrome browser version:53 on my android smartphone.我正在我的 android 智能手机上从 chrome 浏览器版本:53 查看这个应用程序。 Here the button Switch Camera is intended to change from front camera to rear and vice versa on every click.此处的“切换摄像头”按钮旨在在每次单击时从前置摄像头更改为后置摄像头,反之亦然。
If I attach 2 webcams to my desktop and try to access the cameras , I am able to do so without any problem.如果我将 2 个网络摄像头连接到我的桌面并尝试访问这些摄像头,我可以毫无问题地这样做。
But when I try on my mobile by visiting the above web address, I am able to access my mobiles rear camera but when I click again to access my front camera, a black screen is displayed and hence I am unable to access.但是当我通过访问上述网址尝试使用我的手机时,我可以访问我的手机后置摄像头,但是当我再次单击访问我的前置摄像头时,显示黑屏,因此我无法访问。 Can someone please tell me how can I access both my android cameras.有人可以告诉我如何访问我的两个安卓相机。
A small note : Following line of code at line no.141 in javascript section toggles between 0 and 1 for every click and here '0' refers to front camera and '1' refers to rear camera.一个小提示:javascript 部分第 141 行的代码行在每次点击时在 0 和 1 之间切换,这里的“0”指的是前置摄像头,“1”指的是后置摄像头。
v = (v?0:1);
You can't access both cameras simultaneously on most Android devices.您无法在大多数 Android 设备上同时访问两个摄像头。 The only ones i know of that let you access both at the same time are the HTC m8, the OnePlusOne and the Motorola Nexus 6.我所知道的唯一能让您同时访问两者的是 HTC m8、OnePlusOne 和摩托罗拉 Nexus 6。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.