是否可以将智能手机从开放式画廊中阻止?
我有一个用于从智能手机摄像机捕获图像的输入,如下所示:
<input ng-model="fileModel" type="file" name="input_default" accept="image/*;capture=camera"
capture="camera" capture />
如果在已安装的智能手机(OS Android或iOS)上没有相机,则输入将打开手机库。我希望用户被提醒,它没有相机并且不打开设备库。
我在下面尝试过这种方式,但它没有起作用。
var el = document.createElement('input');
if(el.capture == undefined){
// display message user
} else{
// open the camera normally on the device
}
是否可以使用JavaScript从打开画廊 block 智能手机?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是如何通过打开相机并拍照直接与WEBRTC拍摄相机照片的工作示例。
许多政府网站使用这种方法来验证真实性。
这是演示,
https://yari-demos.prod.mdn.mozit.mozit.cloud/en-us/docs/web/api/media/media_streams_api/taking_sthaking_still_still_photos/_sample_.demo.htmo.html
noreferrer
https://developer.mozilla.org/en-us/docs/web/api/media_streams_api/taking_still_photos
This is a working example of how to take photo from camera directly with WebRTC by opening camera and taking photo.
This approach is used by many govt website to validate authenticity.
This is the demo,
https://yari-demos.prod.mdn.mozit.cloud/en-US/docs/Web/API/Media_Streams_API/Taking_still_photos/_sample_.demo.html
And this is complete explanation,
https://developer.mozilla.org/en-US/docs/Web/API/Media_Streams_API/Taking_still_photos