我正在尝试在两个人之间构建视频会议应用程序。我面临的问题是我将视频和麦克风附加到我的流中并发布它。第一次进行呼叫时,音频与视频一起传输,但是当我结束呼叫并再次呼叫时,我可以看到只有视频,并且没有音频在流中传输。我调试了应用程序,麦克风和视频正在附加到流中。无法弄清楚如何结束这一点。任何帮助将受到高度赞赏。这是我的一些代码。谢谢。
camera = Camera.getCamera();
mic = Microphone.getMicrophone();
mic.setLoopBack(false); // prevent input from being routed back to local speakers - helps reduce feedback in some conditions
mic.setUseEchoSuppression(true);
camera.setMode(320,240,15);
camera.setQuality(65536,75);
// setup out going stream
var conn:NetConnection = Connection.getConnection().conn;
outStream = new NetStream(conn);
outStream.attachAudio(mic);
outStream.attachCamera(camera);
outStream.publish(appState.userProfile.username);
// setup in coming stream
inStream = new NetStream(conn);
inStream.play(appState.callingUser.username);
inStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
//inStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandlerForInStream);
这是endCall函数。
if(camera!=null || mic != null)
{
outStream.attachCamera(null);
outStream.attachAudio(null);
outVideo.attachCamera(null);
inStream.close();
outStream.close();
camera = null;
mic = null;
inVideo = null;
outVideo = null;
inStream = null;
outStream = null;
if (newStream)
{
newStream.close();
newStream = null;
}
}