public Attach ( FM conference, string sessionId, Action |
||
conference | FM | |
sessionId | string | |
callback | Action |
|
return | void |
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); }
public void JoinConferenceSession(string conferenceSessionID, Action <Exception> callback) { if (!SignallingExists()) { callback(new Exception("Signalling must exist before joining a conference.")); } else if (!LocalMediaExists()) { callback(new Exception("Local media must exist before joining a conference.")); } if (ConferenceExists()) { signalling.Attach(conference, conferenceSessionID, (ex) => { if (ex != null) { callback(ex); } else { callback(null); Log.InfoFormat("Conference Session is now {0}", conferenceSessionID); } }); } }