Skip to main content
November 14, 2012
Question

Air 3.5 front camera issue

  • November 14, 2012
  • 1 reply
  • 1653 views

I am using the latest air 3.5 sdk to build an video application. But I find that the front camera can not render correctly in spark.VideoDisplay, while the back camera is ok.

My deivce is galaxy nexus, android 4.1.2, the code is below:

protected function init(event:FlexEvent):void

{       

        cam = getFrontCamera();

                               

        if (cam != null)

        {

                videoDisplay.videoObject.attachCamera(cam);

        }

}

public function getFrontCamera():Camera

{

                               

        if (Camera.isSupported == false)

        {

                return null;

        }

        var numCameras:int = Camera.names.length;

        var frontCam:Camera;

                                               

        for (var i:int = 0; i < numCameras; i++)

        {

                frontCam = Camera.getCamera(Camera.names);

                               

                if (frontCam.position == CameraPosition.FRONT)

                {

                        break;

                }

                                                       

                frontCam = null;

        }

                               

        return frontCam;

}

<s:VideoDisplay id="videoDisplay" x="0" y="0" width="100%" height="100%" creationComplete="init(event)">

                <s:source>

                        <s:DynamicStreamingVideoSource host="" streamType="live">

                                <s:DynamicStreamingVideoItem  />

                        </s:DynamicStreamingVideoSource>

                </s:source>

</s:VideoDisplay>

The camera result below:

Any help will be appreciate.

This topic has been closed for replies.

1 reply

November 19, 2012

I am having the same issue. Am using Flex 4.6 and AIR SDK 3.5.

On 3.1, front facing camera works on Galaxy Nexus. With 3.5, am facing this exact issue. Even with 3.5, this works well on other devices such as.

Xperia Mini, iPhone 4s as well.

Were you able to solve this ?

Participant
November 20, 2012

Looks like he created a bug report, I am having the same issue and cannot find a work around on droid bionic after upgrading from 3.4 to 3.5.

Please vote if it looks like your issue, https://bugbase.adobe.com/index.cfm?event=bug&id=3364427

chris.campbell
Community Manager
Community Manager
November 20, 2012

Thanks for the heads up.  I've asked our team to take a look and update the bug accordingly.  As Ten mentioned, please take a minute and leave a comment/vote on the bug.  Any and all info will help.