1 Reply Latest reply on Jun 29, 2009 8:02 PM by Broofa

    How to *STOP* using a camera?


      Is there a way to release a camera after having accessed it from a Flex app?


      I have a long-running application that only occasionally needs to access the camera to take a snapshot.  I have the "take a snapshot" code working fine, but once the app takes control of the camera it prevents other apps from using it.  This is a problem if you want to do something like use Skype or iChat to make a video call.  Currently you have to close my app and then restart it once you're done with the call, which is a headache I really don't want to burden users with.


      Thus, is there some way my app can release it's control over the camera once it's done taking a picture?  (Ideally the app could resume camera control at some later point without having to ask the user for permission to use the camera again.)

        • 1. Re: How to *STOP* using a camera?
          Broofa Level 1

          Finally figured this out.  Calling VideoDisplay#attachCamera(null) will disconnect from the camera.


          However, it appears that trying to do attachCamera(someCamera) followed by attachCamera(null) in the same event loop does not work.  Flex just treats this as a no-op.  It doesn't even show the permission request panel.  To work around this I put the attachCamera(null) in a timeout.