百度人脸识别记录(2):熟悉H5 capture 调用摄像头

193 篇文章 4 订阅
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>input file capture</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, minimal-ui, shrink-to-fit=no">
<style>
body {font-family: Arial, Roboto, 'Droid Sans', 'Hiragino Sans GB', 'Microsoft YaHei', 'Simsun', STXihei, 'sans-serif';font-size: 14px;}
dl:not(:last-child) {overflow: hidden;padding: 10px;margin-bottom: 10px;border-bottom: 1px dashed #dedede;}
dt {padding-bottom: 10px;font-weight: bold;color: #f32600;}
dd {margin: 0;padding:5px 0 0 20px;border-left: 2px solid #cddc39;}
</style>
</head>
<body>
<dl>
	<dt>普通没有 <code>capture</code> 属性</dt>
	<dd><input type="file"></dd>
	<dd><p>没有 <code>capture</code> 捕获属性时,仅为选择上传文件。</p></dd>
	<dt><code>capture=""</code> 为空的时候</dt>
	<dd><input type="file" capture=""></dd>
	<dd><p><code>capture</code> 捕获属性为空时,基于 <code>capture</code> 的值为布尔值类型,所以这个时候可以看到启用了摄像头,<strong>后置摄像头</strong>开启拍照或者录像功能。</p></dd>
	<dt><code>capture="user"</code> 前置摄像头</dt>
	<dd><input type="file" capture="user"></dd>
	<dd><p><code>capture</code> 捕获属性为 <code>user</code> 时,开启前置摄像头的拍照或者录像功能。</p></dd>
</dl>
<dl>
	<dt>类型:视频 多个文件</dt>
	<dd><input type="file" accept="video/*" multiple=""></dd>
	<dd>
		<p>选择多个<strong>视频</strong>类型文件,未使用 <code>capture</code> 属性时。</p>
	</dd>
	<dt>类型:图片 多个文件</dt>
	<dd><input type="file" accept="image/*" multiple=""></dd>
	<dd>
		<p>选择多个<strong>图片</strong>类型文件,未使用 <code>capture</code> 属性时。</p>
	</dd>
	<dt>无类型要求 多个文件</dt>
	<dd><input type="file" multiple=""></dd><dd>
		<p>选择多个<strong>视频</strong>或者<strong>图片</strong>类型文件,未使用 <code>capture</code> 属性时。</p>
	</dd>
</dl>
<dl>
	<dt><code>capture="user"</code> 前置摄像头 视频</dt>
	<dd><input type="file" capture="user" accept="video/*" multiple=""></dd>
	<dd>
		<p>使用 <code>capture="user"</code> 开启前置摄像头时,设定为<strong>视频</strong>类型文件,手机中不会显示<em>照片</em>,同时 <code>multiple</code> 多文件上传无效。</p>
	</dd>
	<dt><code>capture="user"</code> 前置摄像头 图片</dt>
	<dd><input type="file" capture="user" accept="image/*" multiple=""></dd>
	<dd>
		<p>使用 <code>capture="user"</code> 开启前置摄像头时,设定为<strong>图片</strong>类型文件,手机中不会显示<em>视频</em>,同时 <code>multiple</code> 多文件上传无效。</p>
	</dd>
</dl>

</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

漏刻有时

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值