public void PeerConnectionDisconnected(object sender, string message) { Console.WriteLine("User disconnected"); Console.WriteLine("Here can working async compucting"); ClientCell.RemoveRemoteControlling(Connection); Source.I420AVideoFrameReady += WritingVideo; UserDisconnected = true; RestartTimer.Start(); }
public void PeerConnected(object sender, string message) { Console.WriteLine("User connected"); Console.WriteLine("Here stop working async compucting"); Source.I420AVideoFrameReady -= WritingVideo; ClientCell.AddRemoteControlling(Connection); UserDisconnected = false; RestartTimer.Stop(); }
public async Task PeerConnectionClosed(object sender, string message) { Console.WriteLine("Peer Connection Was Disposed..."); if (!Source.Enabled) { Source = await Camera.CreateAsync(SystemConfiguration.VideoDeviceSettings); } ClientCell?.RemoveRemoteControlling(Connection); Connection = await WebRTCPeerCreator.InitializePeerConnection(); Connection = WebRTCPeerCreator.AddVideoTransceiver(Connection, Source); Connection = WebRTCPeerCreator.BindPeerWithController(Connection, this); Console.WriteLine("End of rebuilding peer connection"); }