1 : function publishMe() {
2 : out_ns = new netStream(_root.client_nc);
3 : out_ns.attachVideo(client_cam);
4 : out_ns.publish('myTestStream');//采用默认的live播放形式
5 : }
//播放视频流
1 : function playMe() {
2 : in_ns = new netStream(_root.client_nc);
3 : Published_video.attachVideo(in_ns);
4 : in_ns.play('myTestStream');
5 : }
定义好这些函数后,就可以用下面的代码简单实现
1 : // Connect to the server
2 : doConnect();
3 : // Publish the live stream
4 : publishMe();
5 : // Play back the stream from the server
6 : playMe();