fabian
fabian

Reputation: 5463

Can I access the webcam via a browser plugin/add-On?

I was wondering if I can access the webcam via a browser plugin e.g. for Firefox, Safari, Internet Explorer etc?

Are there already similar plugins/add-ons?

Thanks

Upvotes: 7

Views: 22966

Answers (4)

Siddharth Jain
Siddharth Jain

Reputation: 400

You can use Mediadevices.getUserMedia (https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) to capture webcam stream on browser (chrome and firefox). To play with webcam stream on safari, you would have to use a pollyfill - https://github.com/Temasys/AdapterJS

To record the video/audio stream, you can make use of Media recorder api https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder (Note : recording stream is still a challenge in Safari as there is no support/pollyfill. However, it works perfectly on Chrome and Firefox latest versions).
To make video recording work on Safari, it maybe worthwhile to explore https://github.com/ronghanghu/webcamjs (Note flash plugin needs to be installed and enabled)

Helpful demonstrations : https://webrtc.github.io/samples/
https://mozdevs.github.io/MediaRecorder-examples/index.html
https://hacks.mozilla.org/2016/04/record-almost-everything-in-the-browser-with-mediarecorder/

Upvotes: 1

Savir
Savir

Reputation: 18418

I just found this:

http://www.html5rocks.com/en/tutorials/getusermedia/intro/

One year and a half after this question was made. I haven't tested it, but maybe it'll help.

From the link (just a copy/paste showing how to record something using the camera as input source):

<input type="file" accept="video/*;capture=camcorder">
<input type="file" accept="audio/*;capture=microphone">

Upvotes: 5

It's possible to access the webcam through Flash, for instance.

An example of this is Omegle, which uses Flash to access the webcam.

An alternative is doing it in Silverlight, as in this example.

Finally, there's Java, in which you could write an applet to access the webcam. This article should demonstrate this.

If you wish to do it yourself, you will have to write the plugins yourself.

This can be done using the NPAPI for most browsers, or by writing a BHO (Browser Helper Object) for Internet Explorer.

How to interact with the webcam there depends on which language you choose, as you have full access to system libraries.

Note that writing a custom browser plugin is both harder, and a larger hassle for users, as they have to install something new, as opposed to just using their existing browser plugins.

Upvotes: 5

i_am_jorf
i_am_jorf

Reputation: 54600

None of the major Webbrowser's (IE, FF, Chrome) provide any special support for Webcams. You will need to either use the native OS's API (whatever that may be), or embed Flash in Webbrowser control in your browser plug-in.

Upvotes: 1

Related Questions