如何通过javascript访问摄像头 [英] How to access the webcam by javascript
问题描述
我需要通过JavaScript打开摄像头
我知道可以通过< video>
访问html5,但需要使用纯JavaScript访问摄像头
有人可以帮我或给我一些建议吗?
我只需使用JavaScript访问摄像头,我的英语,我正在使用谷歌翻译。
我无法使用标签'<视频>'
正如我所说的评论,我对你的措辞感到困惑。你说,你知道HTML5可以访问网络摄像头,但是你需要用纯Javascript。
好吧,如果你不知道, HTML5 引入了实时通信 的简称 WebRTC 。其中一部分,引入了一个名为 正如您所看到的,整个演出都嵌入在HTML5的卷展栏/规范中,所以我们无法真正将Javascript与HTML5分开。 I need to open the webcam via JavaScript
I know it is possible to access the html5 by Can someone help me or give me some ideas? I need only access the webcam with JavaScript and sorry for my English, I'm using Google translator. I can't use tag '< video >' As I stated as comment, I'm confused about your wording. You said, you know that "HTML5" can access the webcam, but you need it by pure Javascript. Well, in case you don't know, HTML5 introduced the such called WebRTC which is short for Real-Time Communications. Part of that, a new thing called As you can see, the whole show is embedded in the HTML5 rollout / spec, so we cannot really separate the Javascript from the HTML5 here. Further reading: 这篇关于如何通过javascript访问摄像头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! navigator.getUserMedia() navigator.mediaDevices.getUserMedia(constraints)
的新东西。也就是说,一个ECMAscript对象,它允许您访问用户机器 WebCam 和 Microphone 设备。
<进一步阅读:
<video>
but need access webcam with pure JavaScriptnavigator.getUserMedia() navigator.mediaDevices.getUserMedia(constraints)
was introduced as well. That is, an ECMAscript object, which allows you to get access to the users machine WebCam and Microphone devices.
https://developer.mozilla.org/en-US/docs/WebRTC/navigator.getUserMedia