javascript - 如何修复设备相机不支持移动浏览器 React Js 的问题
问题描述
我创建了一个 React Js Web 应用程序;使用对话框组件打开相机并捕获实时图像。这适用于桌面浏览器,但不适用于手机和 Apple 设备。但在 Safari 浏览器中它可以完美运行。我怎样才能使它在其他浏览器中也能正常工作?
<Dialog
fullScreen={fullScreen}
open={this.state.open}
onClose={this.handleClose}
aria-labelledby="responsive-dialog-title">
<DialogTitle className={"testClassForStyle"} id="responsive-dialog-title">{<Translate
id={"webCam"}></Translate>}</DialogTitle>
<DialogContent className={"camscreen"}>
<div className={"webCamCss"}>
<center><Webcam
audio={false}
height={200}
ref={this.setRef}
screenshotFormat="image/jpeg"
width={350}/></center>
<center><Button onClick={this.capture} className="btn-success text-white">
<Translate
id={"capture"}></Translate></Button></center>
</div>
</DialogContent>
<DialogActions id="actions-btns">
<Button onClick={this.handleClose} className="btn btn-default text-white" autoFocus>
<Translate id={"cancel"}></Translate>
</Button>
<Button onClick={this.handleAddClose} className="btn btn-primary text-white">
<Translate id={"addBtn"}></Translate>
</Button>
</DialogActions>
</Dialog>
解决方案
推荐阅读
- database - 使用 :new 和 :old 在 SQL 中引用不同的表
- mysql - 如何在mysql中更新多个表中的多行
- python - 如何为我的 PyCharm Python 项目安装 yaml 包?
- square - “授权码已被认领”错误
- node.js - Angular 7 和 Nodejs 的验证表单问题
- db2 - 在 DB2 SQL 中,如何使用 FETCH FIRST (n) ROWS ONLY..返回可变数量的行?
- java - 如何解决安装pycharm后出现的启动错误?
- ios - wkwebview 链接在点击时不会打开
- node.js - MongoParseError:在 parseConnectionString 处未转义的登录权限部分
- sql - 如何使用 SQL 在开始日期和结束日期之间拆分值?