iSight and Flash

Discussion in 'Mac Programming' started by asmith3006, Feb 20, 2007.

  1. macrumors member

    Joined:
    Dec 5, 2006
    #1
    Hi all.

    According to http://www.communitymx.com/content/article.cfm?page=2&cid=BF6D4 this webpage it is very easy to display the iSight in a flash movie. However, when I run the attached sample code it doesn't run.

    Would someone kindly try the files on their system to see if they work so I can be sure if it's my Mac or if it's something deeper.

    Also, does anyone have any suggestions about how I could go about this if it doesn't work?

    Cheers
     
  2. macrumors demi-god

    Spanky Deluxe

    Joined:
    Mar 17, 2005
    Location:
    London, UK
    #2
    I can't help with the programming side of things but I'm pretty sure YouTube has a live record via flash application that allows you to use a webcam such as an iSight. I swear I once fiddled with it and my iSight. You have to follow some instructions to right click and enable use of your iSight I think. Sorry for being vague!
     
  3. thread starter macrumors member

    Joined:
    Dec 5, 2006
    #3
    You have to do the same with this, right click on it, settings, change it to Firewire IIDC or whatever. But it doesn't work... on my iMac at least. Most frustrating.

    Does anyone fancy trying the files for me? Or following the instruction on the sight if you don't trust the files.
     
  4. macrumors demi-god

    Spanky Deluxe

    Joined:
    Mar 17, 2005
    Location:
    London, UK
    #4
    Attatch them on here and I could give it a look, I'm no pro at this stuff though.
     
  5. thread starter macrumors member

    Joined:
    Dec 5, 2006
    #5
    it's too big to attach, but if you go to this link the zip file is at the bottom.

    Cheers.
     
  6. macrumors newbie

    Joined:
    Feb 27, 2006
    #6
    I'm not sure if you're working with AS2 or AS3, but here's the code for both:

    AS2:
    Code:
    var my_video:Video; //my_video is a Video object on the Stage
    var active_cam:Camera = Camera.get();
    my_video.attachVideo(active_cam);
    AS3:
    Code:
    var video:Video = new Video();
    addChild(video); // Add the video object to the display list
    video.attachCamera( Camera.getCamera() );
     
  7. thread starter macrumors member

    Joined:
    Dec 5, 2006
    #7
    Neither of those worked for some reason..... I'm not sure what's going on.

    Anyways, I've managed to get the sample files from the link I posts above to work now. It works if you select "USB" rather than "Firewire".

    Does this mean the current iSight cameras connect with USB rather than firewire then?

    I worked this out by going to the youtube recording page and the automatic setup thinggy found the camera on USB. Excellent stuff :)

    Now I just need to work out how to record...... excellet :)

    Thanks for the help.
     
  8. macrumors demi-god

    Spanky Deluxe

    Joined:
    Mar 17, 2005
    Location:
    London, UK
    #8
    Ahhhhh, that exlains it. The internal iSights in the iMacs and MacBooks are USB. Only the external iSight is Firewire. ;)
     
  9. thread starter macrumors member

    Joined:
    Dec 5, 2006
    #9
    don't you just hate it when it's something simple? At least if it's a complicated problem you feel a sense of achievement when you solve it. When it's something as simple as that I just feel silly :(
     
  10. macrumors demi-god

    Spanky Deluxe

    Joined:
    Mar 17, 2005
    Location:
    London, UK
    #10
    Welcome to the world of computers - *especially* programming. Its *always* the simple things that get you!!
     
  11. macrumors newbie

    Joined:
    Mar 9, 2007
    Location:
    Osaka
    #11
    Hello.
    Do you think you are corresponding to iSight only because of the description of
    ActionScript?

    If it is it.

    Code:
    cam = Camera.get(3);//When three is selected, it seems to allocate iSight by the automatic operation. 
    dVideo.attachVideo(cam);
    stop();
    but...
    It is likely not to function by the connection excluding iSight.

    I have not used other cameras.
     
  12. macrumors newbie

    Joined:
    Jan 16, 2009
    #12
    I found this, but not certain if it works across to the PC.

    AS3 / CS4
    Code:
    var camera:Camera;
    for(var i:int = 0; i<Camera.names.length; i++) {
    	trace(String(Camera.getCamera(i).name));
    	switch(Camera.getCamera(i).name) {
    		case "USB Video Class Video":
    		camera = Camera.getCamera(i);
    		break;
    	}
    }
    
    Mine traces out:
    DV Video
    IIDC FireWire Video
    Google Camera Adapter 0
    Google Camera Adapter 1
    USB Video Class Video
     

Share This Page