Using PHP to Access a User's Webcam

2020-02-03 05:00发布

I'd like to allow users to record videos directly from their webcam. I haven't done much work with PHP but am stuck with it for this project. We currently have a system in place for video uploading and encoding, but nothing to actually access a user's webcam. How would you recommend I proceed?

5条回答
家丑人穷心不美
2楼-- · 2020-02-03 05:32

You can't access to underlying hardware objects from a server side scripting language. If you are insterested into access to hardware devices so you have to use "browser components" like adobe flash , active X object, java applets, etc.

查看更多
爷的心禁止访问
3楼-- · 2020-02-03 05:36

The browser itself cannot access a user's webcam. There are proposals for a new type of input field to support this, but is is not currently available. You'd have to do it through a plug-in.

查看更多
【Aperson】
4楼-- · 2020-02-03 05:47

Webcams aren't available to HTML or JavaScript/DOM in any browsers that I know of, so you're going to end up dependent on some sort of plugin. I'd recommend you start your search with Adobe Flash/Flex, though It's possible that Microsoft Silverlight is able to do the same thing. Flex is a bit more reliable technology and has been around longer, but Microsoft is pouring a ton of money into Silverlight, and I expect it to improve radically over the next few years.

查看更多
地球回转人心会变
5楼-- · 2020-02-03 05:47

You need client side technology -- PHP is server side. Check out Adobe Flash/Flex. I don't know anything about Microsoft Silverlight.

查看更多
beautiful°
6楼-- · 2020-02-03 05:56

Check out the mugshot module on Drupal.org. It uses a flash widget to do the image capture, then saves the image as a node. Its code can almost certainly be mined for useful functions if you need to do something similar.

查看更多
登录 后发表回答