2011-08-18 10 views
0

Adob​​e Cirrusを使用してNetGroupを確立しました。新しいストリームの公開時には、NetGroup.Neighbor.ConnectイベントとNetGroup.MulticastStream.PublishNotifyイベントが受信されるため、すべてのクライアントを正常に接続してお互いに見ることができます。Adob​​e Cirrusを使用したonPeerConnectメソッドが起動しない

ただし、ユーザーがパブリッシュされたストリームにサブスクライブすると、パブリッシャーは通知を受け取りません(NetStatusEventなし、onPeerConnectメソッドへのコールバックなし)。しかし、加入者は問題なくストリームを受信します。

onPeerConnectメソッドが動作していないことに関する他の質問はすべてNetStream.DIRECT_CONNECTIONSに関連していましたが、私の場合はNetGroupを使用しています。

ここで何が間違っていますか?

// Only the relevant parts, a few things have been stripped (e.g. connect the netGroup only when the NetConnection has been established etc.) 
var groupSpecifier:GroupSpecifier = new GroupSpecifier("group"); 
groupSpecifier.multicastEnabled = true; 
groupSpecifier.postingEnabled = true; 
groupSpecifier.serverChannelEnabled = true; 
groupSpecifier.objectReplicationEnabled = true; 
groupSpecifier.ipMulticastMemberUpdatesEnabled = true; 
groupSpecifier.routingEnabled = true; 

var netGroup:NetGroup = new NetGroup(netConnection, groupSpecifier.groupspecWithAuthorizations()); 

var netStream:NetStream = new NetStream(netConnection, groupSpecifier.groupspecWithAuthorizations()); 
netStream.client = {onPeerConnect:onPeerConnect}; 
netStream.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus); 

// Never gets called 
public function onPeerConnect(netStream:NetStream):Boolean { 
    trace("onPeerConnect: "+netStream.farID); 

    return true; 
} 

private function onNetStatus(event:NetStatusEvent):void { 
    trace(event.info.code); 

    switch(event.info.code) { 
     case EventCodes.STREAM_CONNECT_SUCCESS : 
      netStream.attachCamera(camera); 
      netStream.attachAudio(microphone); 
      netStream.publish(streamName); 
      break; 
    } 
} 

答えて

3

onPeerConnectは、NetGroupではなく、DIRECT_CONNECTIONSを使用している場合にのみ呼び出されます。残念ながら、これはドキュメントや他の場所では言及されていません。

関連する問題