Flash问题中的相机流

时间:2010-12-30 05:50:05

标签: flex flash stream camera p2p

请帮我填写问号。我想从相机中获取一个源并将其传递给接收功能。另外在flash builder(在设计模式下)如何放置元素以便它们可以播放相机?因为看起来VideoDisplay似乎不起作用

public function receive(???:???):void{
//othercam is a graphic element(VideoDisplay)   
othercam.??? = ????;

}

private function send():void{

var mycam:Camera = Camera.getCamera();
//mycam2.attachCamera(mycam);
//sendstr is a stream we send           
sendstr.attachCamera(mycam);
//we pass mycam into receive
sendstr.send("receive",mycam);
}

1 个答案:

答案 0 :(得分:0)

    public function receive():void
   {
    video = new Video(put-width-here, put-height-here);
    video.attachCamera(mycam); // mycam needs to be a class variable, not local to "send()";

    mybitmap = new BitmapData(fill parameters here);
    update();

    }

    public function update() {
    mybitmap.draw(video);
    // do stuff to your bitmap here...
    }