public Attach ( FM conference, string sessionId, Action |
||
conference | FM | |
sessionId | string | |
callback | Action |
|
return | void |
//Video Chat is the main form public void StartConference(Action <string> callback) { // Create a WebRTC audio stream description (requires a // reference to the local audio feed). AudioStream = new AudioStream(LocalMedia.LocalMediaStream); // Create a WebRTC video stream description (requires a // reference to the local video feed). Whenever a P2P link // initializes using this description, position and display // the remote video control on-screen by passing it to the // layout manager created above. Whenever a P2P link goes // down, remove it. VideoStream = new VideoStream(LocalMedia.LocalMediaStream); VideoStream.OnLinkInit += AddRemoteVideoControl; VideoStream.OnLinkDown += RemoveRemoteVideoControl; // Create a new IceLink conference. Conference = new FM.IceLink.Conference(IceLinkServerAddress, new Stream[] { AudioStream, VideoStream }); // Supply TURN relay credentials in case we are behind a // highly restrictive firewall. These credentials will be // verified by the TURN server. Conference.RelayUsername = "******"; Conference.RelayPassword = "******"; // Add a few event handlers to the conference so we can see // when a new P2P link is created or changes state. Conference.OnLinkInit += LogLinkInit; Conference.OnLinkUp += LogLinkUp; Conference.OnLinkDown += LogLinkDown; // Attach signalling to the conference. Signalling.Attach(Conference, SessionId, callback); }