javascript 如何使用javascript通过网络摄像头录制视频

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27738608/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 07:55:05  来源:igfitidea点击:

how to record the video through webcam using javascript

javascript

提问by ritzzz

I want to record the videos through my webcam and want to upload them to the server. I don't want to use any plugin. How can I atleast just record the videos.

我想通过我的网络摄像头录制视频并将它们上传到服务器。我不想使用任何插件。我怎么能至少只录制视频。

回答by Luba

Use the navigator.getUserMediafunction.

使用navigator.getUserMedia函数。

Check out these url`s. Capturing Audio & Video

查看这些网址。 捕获音频和视频

回答by Leo

There's a project on GitHub called RecordRTC. It also provides a live demo here. This tool could run on browsers supporting WebRTCand getUserMedia. It could record both audio and video.

GitHub 上有一个名为RecordRTC的项目。它还在此处提供了现场演示。该工具可以在支持WebRTCgetUserMedia 的浏览器上运行。它可以同时录制音频和视频。

However, according to data from Can I Use, currently WebRTCand getUserMediaare only supported by Firefox, Chrome, and other blink engine browsers.

但是,根据Can I Use 的数据,目前WebRTCgetUserMedia仅支持 Firefox、Chrome 和其他闪烁引擎浏览器。