仅允许访问 HTML5 中的相机设备 [英] Allow only access to camera device in HTML5

查看:22
本文介绍了仅允许访问 HTML5 中的相机设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用 HTML5 中的 iPhone 相机开发应用程序

I'm currently developing application using the camera for iphone in HTML5 with

<input type="file" accept="capture=camera">

问题是我有一个小清单,可以让我在图书馆和相机之间进行选择.

The problem is that I have a little list that give me the choose between my library and my camera.

我的想法是有两个按钮,一个用于图书馆,另一个用于相机.

My idea is to have two buttons, one for the library and an other for the camera.

我知道只给图书馆而不给相机的方法.

I know the way to only give the library but not for the camera.

问题:有没有办法将这两种类型分开?

Question: Is there a way to separate the two types?

推荐答案

不幸的是不可能:/

摘自 HTML 媒体捕获 - 安全和隐私注意事项:

此外,建议用户代理实现提供一个在启用输入设备时向用户指示并使其用户可以终止此类捕获.同样,用户建议代理提供用户控制,例如允许用户:

In addition, the User Agent implementation is advised to provide an indication to the user when an input device is enabled and make it possible for the user to terminate such capture. Similarly, the User Agent is advised to offer user control, such as to allow the user to:

  • 选择要使用的确切媒体捕获设备(如果存在)
    多个相同类型的设备(例如,
    中的前置摄像头除了主摄像头).

  • select the exact media capture device to be used if there exist
    multiple devices of the same type (e.g. a front-facing camera in
    addition to a primary camera).


中禁用声音捕捉视频拍摄模式.

disable sound capture when in the
video capture mode.

这篇关于仅允许访问 HTML5 中的相机设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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