public bool Unregister(WebRTCSession session) { lock (sessions) { return(sessions.Remove(session)); } }
public void Register(WebRTCSession session) { lock (sessions) { sessions.Add(session); } }
public WebSocketSignaler(WebRTCSession session) { this.session = session; this.peer = session.Peer; this.peer.RenegotiationNeeded += OnRenegotiate; this.session.Start(); }
private void OnPeerConnectionInitialized(WebRTCSession session) { session.Initialized -= OnPeerConnectionInitialized; session.Peer.LocalSdpReadytoSend += SendSdpMessage; session.Peer.IceCandidateReadytoSend += SendIceCandidateMessage; // TODO: session.Peer.SetBitrate() session.Peer.CreateOffer(); }
public MediaServerSignaler(MediaServerService svc, string localId, string streamName, WebRTCSession session) { this.service = svc; this.service.Register(this); this.localId = localId; this.streamName = streamName; this.connection = new NodeDssConnection(service.ServerAddress, $"data/{localId}"); this.connection.MessageReceived += OnMessageReceived; this.connection.Start(); this.session = session; this.session.Initialized += OnPeerConnectionInitialized; this.session.PostShutdown += OnPostShutdown; this.session.Peer.Connected += OnPeerConnected; this.session.Peer.RenegotiationNeeded += OnRenegotiate; this.session.Start(); }
private void OnPostShutdown(WebRTCSession obj) { Dispose(); }