我正在使用我的网络摄像头做一个 flex 项目。一切运行良好,但只有一个人认为我不知道该怎么做:当我从“视频聊天”窗口断开连接时,网络摄像头仍然打开,我无法断开它。注意:当我完成登录后,我会调用一个函数来初始化我的 Vdeo 聊天窗口中的所有内容:
`public function initVars() : void
{
urlBox_publish.text = "rtmp:/live";
streamBox_publish.text = "cameraFeed";
urlBox_playbk.text = "rtmp:/live";
streamBox_playbk.text = "cameraFeed";
initCamera();
return;
}// end function`
public function initCamera() : void
{
trace("In InitCamera");
myCamera = Camera.getCamera();
if (!myCamera)
{
trace("Error, No camera is installed");
errorBox_publish.text = "Error, No camera is installed";
errorBox_publish.visible = true;
bPlayStop_publish.visible = false;
publishBtn.visible = false;
cameraDetectTimer.addEventListener(TimerEvent.TIMER, initCamera);
cameraDetectTimer.start();
return;
}
myCamera.setMode(314, 214, 12);
localVideo.attachCamera(myCamera);
errorBox_publish.visible = false;
bPlayStop_publish.visible = true;
publishBtn.visible = true;
return;
}// end function