dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Auto Webcam Detection

Threaded View

  1. #1
    Flactionscrish Baby Minion's Avatar
    Join Date
    Nov 2005
    Location
    Planet Earth
    Posts
    312

    Talking 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.RESOLVEonResolve);
    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center