views:

3171

answers:

3
+3  Q: 

Silverlight Webcam

Is it possible to access a webcam in Silverlight

From what I've read it's not possible in Silverlight 1.0 but what about 2.0... 3.0 ... 4.0?

+3  A: 

I'm afraid webcam support isn't available in Silverlight 2.0. You might hope for it to be added in a future version, but there's no easy way of doing it now... Saying this, some people have invented various hacks that use other technologies in combination with Silverlight to capture video from the webcam. They typically involve interfacing with Flash, which of course is perfectly capable of utilising webcams. See this article for an example (with source code included). It's not a pretty solution (at least in my opinion), and may not be 100% stable across browsers/platforms, but I think it's the best you're going to get for now. Perhaps you should submit feedback directly to Microsoft if you really want to see support in Silverlight 3.0 (though it's certainly been mentioned elsewhere, so it may already be on the to-do list).

Noldorin
Scottgu acknowledged this as a highly requested feature at MIX09.
jms
No doubt that Flash Already had robust webcam support since years! Any example of silverlight 4 doing motion tracking using webcam ? for ex http://blog.soulwire.co.uk/flash/actionscript-3/webcam-motion-detection-tracking/
bugBurger
A: 

I asked a member of the Silverlight team when they would be coming out with webcam support, and he said, in effect, "Let's just say that it's a really high priority for Silverlight 4.0." That said, it hasn't been officially announced yet, so I wouldn't count on it until MS does make the announcement.

I've used the Silverlight -> JavaScript -> Flash hack in production code, and while it does work, it doesn't work very well. Among other things, it's a pain to keep the Flash camera synchronized with your Silverlight UI. The camera shows up on top of SL child window controls, for instance, and of course, doesn't obey the clipping rules for when, say, it should be scrolling out of sight in a list box. And animations are a PITA as well. It's all possible, just slow and unpleasant, and several orders of magnitude more work than it would be if MS just supported web cams in Silverlight.

Ken Smith
+3  A: 

It is now possible in Silverlight 4.0. Developer preview is available at http://silverlight.net/getstarted/silverlight-4-beta/

Ankit Gupta