如何使用FLEX4使用前置摄像头 [英] how to use front camera using flex4

查看:157
本文介绍了如何使用FLEX4使用前置摄像头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了Android移动简单的摄像头应用程序使用Flex 4的问题是,当我运行该应用程序,它使用了后置摄像头。它不使用前置摄像头。如何更改摄像头。我需要使用前端摄像头,这个应用程序,请帮帮我吧。

I have developed simple camera application for Android mobile using flex 4. The problem is , when I run that application it uses the rear camera. It's not using the front camera. How can I change the camera. I need to use front side camera for this application , kindly help me .

var camera:Camera = Camera.getCamera(cameraIndex.toString());
if (camera)
{
    var ui: UIComponent = new UIComponent();
    var localVideoDisplay: Video = new Video(180, 135);
    localVideoDisplay.attachCamera(camera);
    ui.addChild(localVideoDisplay);                     
    cameraGroup.addChild(ui);
}

这是在code我已经用在我的应用程序。

this is the code I have used in my application.

推荐答案

尝试

function getCamera( position:String ):Camera
{
    var camera:Camera;
    var cameraCount:uint = Camera.names.length;
    for ( var i:uint = 0; i < cameraCount; ++i )
    {
        camera = Camera.getCamera( String(i) );
        if ( camera.position == position ) 
            return camera;
    }
    return Camera.getCamera();
}

使用 getCamera的(CameraPosition.FRONT)

这篇关于如何使用FLEX4使用前置摄像头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆