Highlighted

Major problem with AIR iOS Camera

Engaged ,
Apr 30, 2015

Copy link to clipboard

Copied

Wen I open the camera dialog and then either hit cancel or take a pic and return to my app.... my entire stage zooms.  It looks like its zooming to show any off stage content. If I then rotate the app 180 degrees it readjusts to be normal again. My app is a landscape app.

If I set the app to be EXACT_FIT the problem happens and then auto corrects itself. Still looks really bad for the second that it happens though.

The camera portion is crucial to my app .. so hoping there is a known fix for this.

Any help appreciated as always!

TOPICS
Development

Views

451

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Major problem with AIR iOS Camera

Engaged ,
Apr 30, 2015

Copy link to clipboard

Copied

Wen I open the camera dialog and then either hit cancel or take a pic and return to my app.... my entire stage zooms.  It looks like its zooming to show any off stage content. If I then rotate the app 180 degrees it readjusts to be normal again. My app is a landscape app.

If I set the app to be EXACT_FIT the problem happens and then auto corrects itself. Still looks really bad for the second that it happens though.

The camera portion is crucial to my app .. so hoping there is a known fix for this.

Any help appreciated as always!

TOPICS
Development

Views

452

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 30, 2015 0
Adobe Community Professional ,
Apr 30, 2015

Copy link to clipboard

Copied

Could it be that the camera app is portrait, and your app is getting a resize event? What happens if you disable resize listening before opening the camera, and turn the listener back on, if you need to, when the camera goes away.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 30, 2015 0
Engaged ,
Apr 30, 2015

Copy link to clipboard

Copied

I'll give that a try right now

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 30, 2015 0
Engaged ,
Apr 30, 2015

Copy link to clipboard

Copied

Wait ... which resize event am I supposed ti disable ?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 30, 2015 0
Adobe Community Professional ,
May 01, 2015

Copy link to clipboard

Copied

What stage scalemode are you using? If it's noScale you presumably listen for a resize event in order to know the size of the stage. That one.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 01, 2015

Copy link to clipboard

Copied

I'm actually hoping to use

stage.scaleMode = StageScaleMode.SHOW_ALL;

stage.quality = StageQuality.BEST;


I dont have any manual listeners set up to listen to resize events though.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 01, 2015

Copy link to clipboard

Copied

Another interesting point.. when I use the EXACT_FIT method and it glitches and then resets to the right position.. the quality looks like it changes from BEST to LOW ..  however if I rotate the phone 180 degrees.. the quality resets back to BEST.  I can visually see the quality difference. It's highly noticeable. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 01, 2015

Copy link to clipboard

Copied

I cant believe that in all these years of AIR being supported on iOS that you cant take a photo in landscape mode. This boggles my mind.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 01, 2015

Copy link to clipboard

Copied

I haven't tried to use the camera yet, but in all my AIR apps (landscape games), I use this code:

stage.scaleMode = StageScaleMode.NO_SCALE;

stage.align = StageAlign.TOP_LEFT;

Not sure if it'll help but wanted to throw it out there.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 01, 2015

Copy link to clipboard

Copied

Ya I tried that..  it doesnt help the issue. There are major problems with using the camera in landscape mode.. doesnt look like it's doable.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 01, 2015

Copy link to clipboard

Copied

Are you using an ANE to activate the camera?  What AIR SDK? Maybe you should open a bug at http://bugbase.adobe.com

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 01, 2015

Copy link to clipboard

Copied

No I'm just using the basic camera offerings.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 01, 2015

Copy link to clipboard

Copied

Do you know of any ANE's for handling the camera?  Maybe that would solve the problem?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 01, 2015

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 01, 2015

Copy link to clipboard

Copied

Hmm .. so far only 1 for $40 ..  pricey without knowing if it will solve my problem

I'm hoping Colin can save the day as he has many times over the years  

Grrr..  I'm really surprised though that I cant find anyone with this issue via Google searches.

The stage going all messed up is one issue... the fact that even when you do get a "sort of" fix working .. the stage quality changes to be really low .. until you rotate the device 180 degrees.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 01, 2015

Copy link to clipboard

Copied

You could always write your own, I've written a couple now. You do need a mac and xcode tho.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 01, 2015

Copy link to clipboard

Copied

did you look through the bugbase to see if anyone's filed a bug report on this?  Are you using an up-to-date AIR SDK?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Adobe Community Professional ,
May 01, 2015

Copy link to clipboard

Copied

I'm going to send you $40.

Not really, I made that up. Can you say something about the reason you are using the camera? One solution I've used is to do a normal Flash Camera class, that works well in landscape, and you get the bonus of being able to overlay UI elements.

I have done landscape apps that use the native camera, without problems. I'm not sure why I got away with it.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 01, 2015

Copy link to clipboard

Copied

I just need to use the camera on iOS and Android to take a picture and have that picture as bitmap data on the stage. Pretty simple.  App is in landscape mode.

Hmmm .. I've never used the Flash Camera class

I'm using this

  function initCamera(evt:Event):void{

                       

  endTouchX = mouseX;

  endTouchY = mouseY;

  if (startTouchX - endTouchX < 25 && startTouchX - endTouchX >-25 && startTouchY - endTouchY < 25 && startTouchY - endTouchY >-25) {

  takePhotoBTN.alpha = 1;

  trace("Starting Camera");

                      

                        if( CameraUI.isSupported )

                        {

                                cameraUI.addEventListener(MediaEvent.COMPLETE, imageSelected);

                                cameraUI.addEventListener(Event.CANCEL, browseCancelled);

                                cameraUI.addEventListener(ErrorEvent.ERROR, mediaError);

                              

                                cameraUI.launch(MediaType.IMAGE);

                        }

                        else

                        {

                               trace("This device does not support Camera functions.");

                        }

               

  }

  }     

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Adobe Community Professional ,
May 01, 2015

Copy link to clipboard

Copied

I'm sure you can use the regular Camera class then. Look at the example code here, and also the draw method:

Camera - Adobe ActionScript® 3 (AS3 ) API Reference

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 01, 2015

Copy link to clipboard

Copied

Tried the sample code.. this gives me a live video preview on the stage.  The quality is pretty bad though. Is there a way to give better quality?  Also not sure how to take a picture.  Hoping its not to just draw bitmap of whats on the live feed as I assume that would give blurry results.

Thoughts?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 01, 2015 0
Engaged ,
May 04, 2015

Copy link to clipboard

Copied

So for anyone else that runs in to this.. 

Beta 18 somewhat fixes the issue. It still happens.. only it corrects itself.

My solution..

I created an animation of a black box that is the size of the entire stage... it animates in.. on animation complete it fires the camera. This way you cant see the stage get all jumbled up.  Once you return to the stage.. I set a .3 second delay on the animation removing. This creates a seamless transition.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 04, 2015 0