uni-app webview 嵌套h5时 input type="file" capture="camera" 无法直接调用相机拍照

uni-app webview 嵌套h5时 input type=“file” capture=“camera” 无法直接调用相机拍照

操作步骤:

  • uniapp app端webview嵌入https协议html页面

预期结果:

  • 可直接调起相机拍照,屏蔽相册、文件等其它选项

实际结果:

  • 为直接拉起相机拍照

bug描述:

  • webview 嵌套h5时 <input type="file" capture="camera" />,android上无法直接调用相机拍照,微信内打开链接或ios均可直接调起拍照
  • 注:嵌入html为https协议,html 代码配置如下图,
  • hbuilderx版本:4.28.2024092105-alpha
信息类别 信息内容
产品分类 uniapp/App
PC开发环境 Mac
PC系统版本 macOS 10.15.7
手机系统 Android
手机系统版本 Android 14
手机厂商 所有机型
手机机型 荣耀50
页面类型 vue
vue版本 vue3
打包方式 云端
项目创建方式 CLI
CLI版本号 3.0.0-alpha-4030220241101001

Image Image Image


更多关于uni-app webview 嵌套h5时 input type="file" capture="camera" 无法直接调用相机拍照的实战教程也可以访问 https://www.itying.com/category-93-b0.html

3 回复

该用通信调用 uniapi 或者 uts api。webview 的表现由宿主环境决定

更多关于uni-app webview 嵌套h5时 input type="file" capture="camera" 无法直接调用相机拍照的实战教程也可以访问 https://www.itying.com/category-93-b0.html


朋友 我也遇到这个问题了 请问解决了嘛

换方案了,通过webview通信触发,调用APP端方法,成功后再下发至web端

回到顶部