android webview调用摄像头,使用前端代码js vue等调用webview摄像头或者文件

写着文章的初衷还是想让后来者少走一点弯路,度娘出来的确实坑爹,教程基本都是老的,只能调用文件或只能调用摄像头,本次测试再android 8.0上小米pad上测试过,需要的拿走

先上个图,形象一些

2644acd3606b

732D4C9AC1A5FB364399FD0BCED199B0.jpg

权限这块是

本地测试html 放在assets目录下

/p>

"-//W3C//DTD XHTML 1.0 Transitional// EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

H5调用手机相册摄像头以及文件夹

input{outline: none;height: 30px;line-height: 30px;display:inline-block;font-size: 1rem;width: 50%;border:none;padding-left: 20px;color: #a8a8a8;}

#takepicture_1{width: 15%;height: 32px; margin-right: 8%;border:none; background: url(images/camera_03.png) no-repeat;display: inline-block;float: right;outline: none;padding-left: 0px;}

#takepicture{width:100% !important;height:32px!important;border:none !important; background: url(images/camera_03.png) no-repeat !important;display: inline-block !important;float: right !important;outline: none !important;padding-left: 0px !important;opacity: 0;}

.images{width: 100%;height: auto;text-align: center;}

#preview{max-width: 100%;height: auto;display: inline-block;margin:auto;}

上 传:

οnfοcus="if (placeholder =='点击输入或者上传图片'){placeholder =''}"

οnblur="if (placeholder ==''){pl

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值