AIR3新功能,对前置摄像头的支持

AIR3新功能,对前置摄像头的支持

屏幕截图:

下面的代码是返回请求的摄像头的简单函数:

// Get the requested camera. If it cannot be found,
// return the device's default camera instead.
private function getCamera(position:String):Camera
{
  for (var i:uint = 0; i < Camera.names.length; ++i)
  {
    var cam:Camera = Camera.getCamera(String(i));
    if (cam.position == position) return cam;
  }
  return Camera.getCamera();
}

Read source: Flash Codes: AIR 3 New Feature, Front Facing Camera Support | Adobe Flash Lite http://www.adobe-flashlite.com/?p=2781#ixzz1VKxgpg00

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: