cataclysmicrewind/CameraDetection

refresh list of cameras?

Closed this issue · 6 comments

Is there a way to refresh the list of cameras after the flash app is loaded?
If a user connects it's webcam after the app is loaded Camera.names doesn't have it listed.
If I'm refreshing the webpage I can see it but that's a bad user experience.

Thanks

"Calling the names property requires an extensive examination of the hardware." - http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Camera.html#names

I am not sure if this means it only does the 'examination' once in the lifetime of the player, or if each time you call it, it re-examines. Based off your comment, it seems its a one time thing.

Unfortunately, I know of no other way. (yet...?)

It seems they only recheck the list if it was empty
but sometimes you have a false driver that looks like a camera but it's not.
In that case, the new connected camera will be undetected.
I guess we have to live with that.

Thanks

Sounds like your best bet is to include some UI that asks the user to make sure their camera is connected before running CameraDetection. A simple step (in my opinion) that could help reduce this number of occurrences of this issue. Then, if there is still nothing, there will have to be a reload.

I'm not sure of your situation, but it may be a better experience to just reload the swf and not the entire html page, so you could look into using ExternalInterface and Javascript to reload the swf (maybe passing an embed parameter specifying the step they are at in the process) and then it will reload and (hopefully) start where they left off.

Reloading the swf is complicated in my case because I'm implementing a video chat between 2 users.
Even than, reloading the swf usually doesn't help and not even reloading the browser tab.
I have to close the browser and open it again.

Asking the user connect the camera before loading the swf is an option but will require another step and confirmation in the UI which will degrade the user experience.

Maybe Adobe will be kind to fix / improve this issue.

you don't need to ask the user before loading the swf. You can ask them before accessing Camera.names the first time. That may help streamline the UI process and not make it quite as clunky.

There appears to be a bug already listed for this issue. Vote for it. That may be the best we can do right now other than finding a workaround that is consistent.

https://bugs.adobe.com/jira/browse/ASL-235

*this bug mentions a section of the ASDocs that I missed. But what they quote is from the .getCamera() function if you want to look at it yourself.

**did you just make that ticket in Adobe JIRA?

If you are also in this feature you might want to vote for the following issue
https://bugbase.adobe.com/index.cfm?event=bug&id=3327544