Skip to main content
Participant
August 30, 2012
Question

iPhone does not display camera

  • August 30, 2012
  • 5 replies
  • 1314 views

Hi,

I wrote a mobile device application for android and ios. On android everything works fine. But on iOS / iPhone I cannot capture images from the camera. The screen just left blank.

Here are some snippets of my code:

videoDisplay = new Video(videoSize, videoSize);

//...

camera=Camera.getCamera();

camera.setMode(8000,8000,24);

videoDisplay.attachCamera(camera);

sv.addChild(videoDisplay); // sv: <s:SpriteVisualElement id="sv" width="250" height="250" />

I testet Camera.isSupported(), I verified that the camera is installed (*), everything gives me the feedback it should work. The render mode is set to CPU (in the application xml file). So I am pretty clueless right now.

I test it on iPhone 3GS with iOS 5.

Can you help me out?

Thanks in advance.

* http://help.adobe.com/en_US/as3/dev/WSfffb011ac560372f3fa68e8912e3ab6b8cb-8000.html#WS5b3ccc516d4fbf351e63e3d118a9b90204-7d38

This topic has been closed for replies.

5 replies

Colin Holgate
Inspiring
August 30, 2012

I don't believe the iPhone 3gs camera can do an 8000x8000 pixel image. Does it work better if you try camera.setMode(320,240,24)?

MFEK195Author
Participant
August 30, 2012

This is just a cheap trick to get the best possible quality of the camera. The setMode function ensures realistic values.

"Sets the camera capture mode to the native mode that best meets the specified requirements. If the camera does not have a native mode that matches all the parameters you pass, the runtime selects a capture mode that most closely synthesizes the requested mode. This manipulation may involve cropping the image and dropping frames.  "

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Camera.html#setMode%28%29

Nevertheless I tested it with 320/240, but with the same result.

Nimisha1
Participating Frequently
September 3, 2012

I tried repoducing your issue using your code on an iPhone 3G S(with iOS 5.1.1)  and camera is working fine.Can you please share your app with me @nimisha1@adobe.com so that I can look into this issue?