-
Flactionscrish
Auto Webcam Detection
4.19.11 **UPDATE** Now on GitHub. Also, much better than before.
This project 'CameraDetection' does one thing; Find the first working Camera object in AS3.
This class looks at all of the available Cameras in the Camera.names list and tests them. Using a combination of fps and activity, each Camera is looked at until one is deemed usable.
It's pretty simple to use:
PHP Code:
import ktu.media.CameraDetection; import ktu.events.CameraDetectionEvent;
var cd:CameraDetection = new CameraDetection(); cd.addEventListener (CameraDetectionEvent.RESOLVE, onResolve); cd.begin();
function onResolve (e:CameraEvent):void { switch (e.code) { case CameraDetectionEvent.SUCCESS: var myCamera:Camera = e.camera; break; case CameraDetectionEvent.NO_SUCCESS: // none of the camera's worked properly break; case CameraDetectionEvent.NO_PERMISSIONS: // the user denied permission break; case CameraDetectionEvent.NO_CAMERAS: // no camera's were found break; } }
Last edited by Baby Minion; 04-19-2011 at 08:53 AM.
Reason: a lot has changed
ktu[k-two]
he who hesitates is lost; so i guess i'll wander intently
Are you sure this is real?
Life is Love, Love is Blind, Blind we go through Life.
Life isn't hard, dealing with your self is.
The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.
-
Flactionscrish
I've made an update to this class. It now has better detection, and faster detection on Mac laptops.
ktu[k-two]
he who hesitates is lost; so i guess i'll wander intently
Are you sure this is real?
Life is Love, Love is Blind, Blind we go through Life.
Life isn't hard, dealing with your self is.
The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.
-
Flactionscrish
I have made another update to this class.
Added better support for determining permissions.
Updated some logic.
Cleaned up code.
No magic values.
This is a great class folks
ktu[k-two]
he who hesitates is lost; so i guess i'll wander intently
Are you sure this is real?
Life is Love, Love is Blind, Blind we go through Life.
Life isn't hard, dealing with your self is.
The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.
-
Flactionscrish
2012.10.06 update
UPDATED 2012.10.06
A lot has changed:
MediaPermissions object makes asking for permission easy as, well, adding an eventlistener to an object...
CameraChecker was a pleasant abstraction that simplified the CameraDetection code
check out the blog post
go to github to get it
ktu[k-two]
he who hesitates is lost; so i guess i'll wander intently
Are you sure this is real?
Life is Love, Love is Blind, Blind we go through Life.
Life isn't hard, dealing with your self is.
The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.
-
Senior Member
Thumbs up for updating 2 years old project!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|