如何将摄像头的信息实时显示在网页上?
如何将摄像头的信息实时显示在网页上?
[解决办法]
package
{
import flash.display.Sprite;
import flash.media.Camera;
import flash.media.Video;
import flash.events.StatusEvent;
import flash.events.Event;
import flash.text.*;
import flash.utils.*;
public class LuxFlashCamera extends Sprite
{
private var camera:Camera;
private var videoDisplay:Video;
public function LuxFlashCamera()
{
camera = Camera.getCamera();
if(null != camera)
{
camera.addEventListener(StatusEvent.STATUS, OnStatus);
videoDisplay = new Video(320, 240);
videoDisplay.x = 126;
videoDisplay.y = 283;
videoDisplay.attachCamera(camera);
this.addChild(videoDisplay);
}
else
{
trace("Could not find the Camera!");
}
}
}
}