Quantcast
Channel: Adobe Community : All Content - AIR Bugs and Performance Issues
Viewing all articles
Browse latest Browse all 1419

Air 3.5 front camera issue

$
0
0

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[i]);

                               

                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:

魔方手机助手_Galaxy Nexus_20121113181740.png

 

Any help will be appreciate.


Viewing all articles
Browse latest Browse all 1419

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>