Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Bug: WebcamPublisher always gets the first camera

Avatar

Level 2

Hi,

It seems WebcamPublisher always gets the first camera in the list, no matter what camera is chosen by the end user. Beside this, at some point in WebcamPublisher, it has been hardcoded to use Apple's isight camera, if no cam was found:

if( _camera==null){

// If there is no camera , create it and attach it to the stream

if (_cameraNameIndex==null && Capabilities.os.indexOf("Mac OS 1")!=-1) {

// it's silly season - let's try to detect iSight cams, if nothing gets specified

var l:int = Camera.names.length;

for (var i:int=0; i<l; i++) {

if (Camera.names[i]==ISIGHT_NAME) {

_cameraNameIndex = i+"";

break;

}

}

}

Could someone from the lccs development team respond about the quality of code in lccs library, and whether the lib is supposed to be ready for production use. I have asked this in my previous post, but not response has been given so far.

Aureliano

4 Replies

Avatar

Former Community Member

Hi there,

How are you getting your end user to choose their camera? We've had

customers successfully able to choose different cameras before. Re: the

ISIGHT, this is a workaround for a Flash Player issue, where that camera

doesn't get selected by default - this detects whether nothing has been

selected, and selects the Isight if it exists.

The SDKs are generally ready for production use - we have several

commercial applications based upon them. That said, no software is perfect,

and we're continuously updating LCCS (usually every 1.5 months or so) based

on bug reports and feature requests from the community. Does this satisfy

your question?

nigel

Avatar

Level 2

Hi Nigel,

Th problem occurs with Webcamera pod.

In WebcamPublisher#onStreamReceive the camera is initialised like this:

_camera= Camera.getCamera(_cameraNameIndex);

where _cameraNameIndex is null. I guess that's why the first camera is always chosen. Also, _cameraNameIndex does not seem to be bound to the selected value of camera in SecurityPanel.CAMERA.

Aureliano

Avatar

Former Community Member

Hi,

The WebcamPublisher by default, selects what is returned by the player's Camera.getCamera() API i.e. the default camera player could detect. This is when _cameraNameIndex is null. If you want, you can set the cameraNameIndex property i.e. the camera name string( you can do that by getting Camera.names API in flash player) before starting the Webcam. It will then take the camera you mentioned.

In fact we have one of our real life application that uses this property to set the camera you want to see.

You can always use your handler to the selected value of camera in SecurityPanel.CAMERA and set it to the cameraNameIndex property.

And lastly, yes our code is production ready. We have our own commercial apps as well as enterprises using it for building application. If you want to change any part of the code, you are free to do so.

Hope this helps

Thanks

Hironmay Basu

Avatar

Former Community Member

I've seen the webcam bug that you're referring to on OS X. It appears to be something funky about how OS X represents the iSight. Sometimes it shows up as DVVideo, other times it's listed as a USB webcam ( You can see this in the System Preferences panel as well). I think that in their attempt to make OS X easier to use, they made it a bit unpredictable.

We use LCCS in production, and while it has its lumps ( all code does ), I'm very pleased with both the quality of the code and the responsiveness of the team.