如何获取流的名称(RTMFP NetGroup问题,Flex / AS3)

我正在使用新的RTMFP协议和NetGroups在Flex中实现点对点视频会议应用程序。 假设该组的名称是Group1。 我想做的是;当新对等体连接到Group1时;为每个加入的对等体创建一个新的视频显示,并立即播放他/她的流。 我听
NetConnection
"NetStream.Connect.Success"
NetStatus
事件;我想添加新的同伴并播放他/她的流。 但我的问题是: 我如何知道流的名称,以便我可以为该加入的同行播放该流。
NetStream.Connect.Success
只会给我
event.info.stream
属性,但我找不到要为该特定对等体播放的流的名称。 这是代码的简短版本:
private function connect():void
{
    var conn:NetConnection = new NetConnection();
    conn.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
    conn.connect(rtmfpServer);
}

private function setupGroup():void
{
    var gspec:GroupSpecifier = new GroupSpecifier("Group1");
    gspec.multicastEnabled = true;
    gspec.postingEnabled = true;
    gspec.serverChannelEnabled = true;
    var group:NetGroup = new NetGroup(conn, gspec.groupspecWithAuthorizations());
    group.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
}

protected function onNetStatus(e:NetStatusEvent):void
{
    switch (e.info.code)
    {
        case "NetConnection.Connect.Success": //connected to the server
        setupGroup(); //create and connect to the group
        break;

        case "NetGroup.Connect.Success": //connected to the group
        publishMyVideo(); //create a player for my own video and publish it to the group
        break;

        case "NetStream.Connect.Success": //a new stream is connected
        if (NetStream(e.info.stream) != myStream) //if this is not my own stream; it's a new joining peer...
        {
            createPlayerForPeer(); //Create a video player for each joning peer
            playPeersVideo(); //what is the stream name to play?
        }
        break;
    }
}
任何帮助表示赞赏.. 谢谢..     
已邀请:
     case "NetGroup.MulticastStream.PublishNotify":
          trace(event.info.name)
          break;

     case "NetGroup.MulticastStream.UnpublishNotify":
      trace(event.info.name)
      break;
您可以从上面的代码中获取流名称.....您将使用某个名称发布您的信息流,并且该名称将显示在此处,我想当
NetStream.Connect.Success
火灾时此信息也显示不确定......欢呼     
streamIn = new NetStream(conn, NetStream(e.info.stream).farID
//...
streamIn.receiveVideo(true);
streamIn.receiveAudio(true); 
streamIn.play(/*here you need to use the string you pass to NetStream.publish() on the other side*/);
    

要回复问题请先登录注册