That Darn Camera API

It's a nice API, but it's not working like I wan't it to in my Adobe AIR app (desktop AIR, and no it's not Flex.)
This is basicly the code that haldels the cameras:
cam1 = Camera.getCamera("0"); //Bult-in Front Camera
cam2 = Camera.getCamera("1"); //Bult-in Back Camera
cam3 = Camera.getCamera("2"); //USB Webcam
vid1.attachCamera(cam1);
vid2.attachCamera(cam2);
vid3.attachCamera(cam3);
It works like normal at first, but if I connect another camera, or disconnect a camera, that camera's view freezes, but flash still thinks it's connected, and "Camera.names" still lists it.
I also tried calling this code every 500ms with setInterval, but with the same result.
How can I get flash to update the Camera API when a camera is connected/disconnected?

Well, that worked for droping the connections to the cameras, but the camera list still won't reload. If I connect anthother, it can't tell, same if I unplug one.
Maybe I can attach to as many cameras as I can, and then disconnect any that aren't sending new frames. Is there any way to do that?

Similar Messages

  • Camera API problem after app crashed (winrt)

    Dear Sirs.
    I am developing windows phone runtime app (8.1) and testing it on my Nokia Limia 520 smartphone.
    I work with Camera Api (CameraPreviewImageSource from Nokia.Graphics.Imaging (Nokia Imaging SDK v 1.2.151 from NuGet)). But I think this package is not important info.
    Sometimes, after using camera api many times, for instance more than 30th the app crahes. The reason of app crash in my view not important too. (Of course it is important but I ask about restore phone state after the app crashes because it may happens after
    the memory consumption exception for example)
    I think because app crahes I don't call Dispose method for Camera Api and after I restart the app I see the green screen in the view where I use camera api to show user images from the camera. Also I see the green screen when I launch the standart app for capturing
    photo.
    It will fix only when I restart the phone.
    I have tried to do the following things:
    1) Add handler for OnSuspending event:
      private async void OnSuspending(object sender, SuspendingEventArgs e)
                var deferral = e.SuspendingOperation.GetDeferral();
                //cleanup camera resources
                await CleanupCaptureResourcesAsync();
                deferral.Complete();
    2) Add handler for OnUnhandledException event:
    private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
            e.Handled = true;
            CleanupCaptureResourcesAsync().GetAwaiter().GetResult();
            Frame rootFrame = Window.Current.Content as Frame;
            if (rootFrame!=null) rootFrame.Navigate(typeof (BlankPage11), null);
    CleanupCaptureResourcesAsync method:
     public async Task CleanupCaptureResourcesAsync()
                if (CameraPreviewImageSource != null)
                    CameraInitialized = false;
                    await CameraPreviewImageSource.StopPreviewAsync();
                    CameraPreviewImageSource.Dispose();
                    CameraPreviewImageSource = null;
    It is works when I relaunch the app (manualy close and start it again). But when exception occurs it is not works.
    Could you please help me? How can I handle an exception, or if it not possible in some ways (as I have read at https://msdn.microsoft.com/en-us/library/dn532194.aspx) is there any way to restore Camera Api after app launched again (after crash)?
    Best regards,
    Aleksandr Terentev

    Thank you for your answer.
    However, I think the WinDebug wouldn’t help me enough. Because apps may crash in many situations. In my view I need either app global exception mechanism for the purpose of releasing camera api by calling Dispose method when an exception
    occurs or mechanism for restoring the state of the phone camera api after app has crashed.
    Yes, I can save the realtime app status but it wouldn’t help. Because when you try to initialize camera api again it wouldn’t work because the app didn’t call Dispose method and didn’t release the phone camera api.
    This situation is described in the MSDN article:
     “It is extremely important that you properly shut down and dispose of the MediaCapture object and related objects when your app is suspended. Failure to do so could interfere with other apps accessing the device's camera which will
    result in a negative user experience for your app.”  
    (https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn642092.aspx)
    But when the app crashes, OnSuspending event won’t be triggered, in my view. Therefore, after this no one app can use the camera and you have to restart your phone.

  • In firefox auroras new camera API I am only getting 320x240 resolution images. Is this configurable?

    While testing Firefox Aurora's new Camera API I found that I'm only receiving 320x240 png files. For our needs this would have to be a higher resolution image. Is this configurable? Or is this an issue with the device or something else?
    I'm using the Samsung Galaxy Nexus S.

    It is a limitation of the initial version. We have improved it, interfacing with the default camera app on the phone. We plan to release this change in Firefox 11.

  • My ipad is not being recognized by the new iTunes update that just came  out about a week ago it worked fine till the update I have windows 8.1 does anyone know how to fix this problem and I just bought my ipad mini about a month ago

    My ipad mini is not being recognized by the new iTunes update that just came  out about a week ago it worked fine till the update I have windows 8.1 does anyone know how to fix this problem and I just bought my ipad mini

    I found this is another thread - same issue.
    Re: iTunes has stopped working. Why? 
    Sep 11, 2013 6:07 AM (in response to thurdy)
    Resolved!
    After contacting Apple, I received a reply from their engineers:
    Copy QTMovieWin.dll from:  C:\Program Files (x86)\Common Files\Apple\Apple Application Support
    to: C:\Program Files (x86)\iTunes
    And that did the trick.
    Message was edited by: Stryder777

  • Has anyone else noticed that Adobe Camera Raw 7.x exhibits odd behavior compared to version 6.x?

    I have found no discussion of this subject on Adobe's forums, so I am asking here. I find that Adobe Camera Raw 7.x's "auto" mode frequently produces overexposed images with lots of blowouts necessitating much more manual tweaking than was required with the older 6.x series of plug-ins. Has anyone else noticed this behavior?

    I have found no discussion of this subject on Adobe's forums, so I am asking here. I find that Adobe Camera Raw 7.x's "auto" mode frequently produces overexposed images with lots of blowouts necessitating much more manual tweaking than was required with the older 6.x series of plug-ins. Has anyone else noticed this behavior?

  • HT1338 where can i get replacement discs of the operating system ...that originally came with my md311 17" macbook pro?

    where can i get replacement discs of the operating system ...that originally came with my md311 17" macbook pro?

    Call Apple and give them your serial number and they will send you the disks for a nominal charge.

  • HT204389 I just got an iPhone 4S model number MD439LL/A still have the box that it came in along with other info. I can not find Siri. I have looked in settings general and  settings general restrictions. Can anyone help me out?

    I just got an iPhone 4S model number MD439LL/A still have the box that it came in along with other info. I can not find Siri. I have looked in settings>general and  settings>general>restrictions. Can anyone help me out?

    That model is an iPhone 4, not a 4S.
    http://support.apple.com/kb/HT3939

  • PhoneGap: Camera API | ADC Presents: PhoneGap | Adobe TV

    Developer Evangelist Kevin Hoyt demonstrates how to use the Camera API with PhoneGap to take pictures with your mobile phone’s camera, or load photos from the gallery.
    http://adobe.ly/zQPiqJ

    Hi, are any of the files in this presentation available online?

  • Oh no! "Deprecated API Usage - Apple no longer accepts submissions of apps that use QuickTime APIs."

    Tried to submit an app to the Mac App store and I received this now:
    "Deprecated API Usage - Apple no longer accepts submissions of apps that use QuickTime APIs."
    Looks like a fix is in for Adobe Air (https://bugbase.adobe.com/index.cfm?event=bug&id=3680732), but I'm not sure if the same is being performed on Director.
    I'm not using any Xtras or anything, I think this is just embed within the Director builds.
    Looks like submitting anything to any Apple App store is going to be on hold for everyone until this gets fixed.

    Hi,
    Looks like this issue has been fixed in April 8th, 2014 release of AIR SDK. So the latest release 13.0.0.111 on May 13th, 2014 will have this issue fixed.
    Download Adobe AIR SDK
    Release Notes | Flash Player® 13 AIR® 13
    Thanks!
    Mohan

  • Is it possible that the camera itself isn't compatible with FCE?

    Hello,
    I am working on a macbook osx in final cut express with a JVC mini DV GR-D70U camcorder. I have set my easy setup to DV-NTSC but FCE is still not recognizing my camera. My camera is set on play back and connected with a USB. The last film I created was with a european camera, so maybe there is one more setting I need to change? Could it be possible that my camera isn't compatible with my operating system?
    Thank you,
    Emily

    My camera is set on play back and connected with a USB.
    USB will work for downloading stills photos but not for video from the tape.
    Get yourself a 4-6 pin firewire/iLink cable and use Log and Capture in FCE.
    The FCE Easy Setup sounds right for NTSC footqge.
    Al

  • HT201272 How to retrieve or reinstall an app that originally came with the iPad (i.e. YouTube)

    Little fingers got a hold of my iPad & accidently deleted the YouTube app that originally came with the iPad, anyone know how to retrieve the app?

    YouTube is removed in IOS 6
    You can use the iPhone version of YouTube or Jasmine
    http://itunes.apple.com/sg/app/youtube/id544007664?mt=8
    https://itunes.apple.com/sg/app/jasmine-youtube-client/id554937050?mt=8

  • TS1424 I bought an album that also came with music videos. All the songs downloaded properly, but none of the videos. Next to them it said Stopped-Error 3150, I tried to restart the downloads and now most just say Stopped, some say Stopped-Error 8003. Hel

    I bought an album that also came with music videos. All the songs downloaded properly, but none of the videos. Next to them it said Stopped-Error 3150, I tried to restart the downloads and now most just say Stopped, some say Stopped-Error 8003, which means Network issues, but after checking, I found there are no issues with my network. Help?

    I am having this same problem with my brand new Mac Pro. It seems to be tied to the computer awaking from sleep (no I am not leaving the iPod connected while sleep... I am referring to waking the computer from sleep and then connecting iPod as opposed to restarting the computer and then connecting the iPod). In other words, if you are getting this error message, try ejecting the iPod, restart your computer, then connect the iPod and see if the error message goes away. For me it does, but I only get one shot at it, if I eject the iPod and then reconnect it, the error message returns. This happens on both iPods I have. I have rebooted (hold menu-select) and gone to disc mode (hold select-play) and the error message remains. The only way it goes away is to reboot the computer, then I get one shot at hooking up an iPod.
    I NEVER had nor get this error message when I connect to the Windows PC that I started with. Perhaps the iPod does not like moving from PC to Mac?

  • That darn "My Touch opened as a camera!" problem

    Now it's happened to me too! Before I upgraded to 2.0, this never happened before. Now that I'm all updated and upgraded, a little thing comes up asking if I want to open up my ipod to look at the pictures. I can still go into iTunes and use my Touch, I just find this annoying and would like help on how to fix this. Thanks a lot. PEACE!

    iPhone and iPod touch: Disabling digital camera notification in Windows Vista
    iPhone and iPod touch: Disabling digital camera notification in Windows XP

  • Why do I get 'ResolveManifestFiles task failed' error when building a WPF app that references WinRT API?

    0
    down vote
    favorite
    I am working on a WPF app that I want to create for Windows 8. I followed steps mentioned in
    Hansleman's blog to make some manual modifications using WinRT functions in a WPF app. Everything worked well, until I tried to publish the app. When I clicked on publishing the app I got error "The 'ResolveManifestFiles' task failed unexpectedly.
    System.ArgumentException: Value does not fall within the expected range."
    Afterwards, it will produce the same error when attempting a simple solution build.
    Even if you create a simple WPF project and add the references mentioned in blog to access WinRT functions and publish, this issue can be reproduced.
    I think it would be common scenario to call WinRT functions from WPF and someone should have done it. Is anyone aware what should be done to fix this issue?

    I am having the same problems and came across this article while researching a workaround. 
    It is surprising more people aren’t talking about this.
    Here are the steps to reproduce the problem; Using Visual Studio Express 2012 (x64) create a new VB Windows Forms Application. 
    Unload the project and edit the [ProjName].vbproj in the solution explorer. 
    Add <TargetPlatformVersion>8.0</TargetPlatformVersion> to the <PropertyGroup>. 
    Save and reload the project.  In Add Resource/Reference Manager add the Windows.minmd found under Windows/Core. 
    This WinRT/Desktop solution will run as expected.  Now try to Publish this solution. 
    It will FAIL with the following ERROR; “The ResolveManifestFiles task failed unexpectedly, Value does not fall within the expected range.” 
    Attempting to build or run the solution again now will fail with the same Error. 
    The only way to build the project now is to remove the “Enable ClickOnce security settings” option under the project properties Security settings. 
    Occasionally using this trick, the solution will build but not run. 
    When that happens jiggle around with Debug/Release Solution Configurations and the Any CPU/x64 Solution Platforms then rebuild and try the run again. 
    This fussing around will get you through development however any attempt to publish with restore the ClickOnce security setting and create the previous Error.
    The first question here is how do you publish a WinRT app for the desktop with VS2012 Express. 
    Then secondly, if that is not possible can we publish this Express solution with a 3rd party deployment tool like InstallShield Limited Edition or the WIX Toolset. 
    Neither however seems functional in a VS Express environment. 
    Then thirdly, are there ways to access hardware sensor devices from a desktop solution without resorting to the WinRT API.
    Any ideas or new research directions would be greatly appreciated.

  • Can I trade my MacBook Air for a new MacBook Air that just came out?

    I was wondering that I bought the MacBook Air in November of 2010 and I would like to get the new MacBook Air can I just do a trade from Best Buy or Apply?

    Well... you can return your Air as part of Apple's recycle program and get an Apple Gift Card for it's value.  Unfortunately, they (well, a company that does this sort of thing) sets the "value" which is nothing close to what you would be able to get on your own:
    http://www.apple.com/recycling/computer/
    I don't think anyone intended to insult you.  You sort of implied in your original post that you should be able to exchange something that you purchased 8 months ago.  In fairness, I'm aware of very few places that offer a return policy that liberal.  When you clarified that you could pay up front to be guaranteed a certain percentage of the original value over time... that certainly made more sense (although Apple does not offer the exact thing... but only what I had posted the link to above).
    Having said all that... when I purchased my Air, it was only about a month or so before the new ones came out.  I knew that the new ones were coming out.  I was actually concerned about the loss of the dedicated GPU and the fairly significant drop in GPU performance with the integrated Intel processor.  Granted, the new processors are about twice as powerful... that's significant.  But, I don't really do anything processor intensive on my machine.  So doubling the power for me was a non-issue.  I do just want the OS to run smoothly and fluidly and the nVidia GPU in the machine that you (and I) have does a great job.  So not only did I know that new Airs were coming out, I bought mine because I didn't want the newer model.  Of course the new Airs have Thunderbolt as well... but I'm not expecting that to take off for a while yet (and USB 2.0 has worked fine for me for years).  If you do processor intensive stuff, you could have good reason for wanting the newly released Air (although in getting the last model, I would expect you did't have heavy duty processing needs).  I personally am happy I have the previous model and the release of the new model does not devalue mine in the least.

Maybe you are looking for