private void ReceiveWebCam_OnClick(object Sender, RoutedEventArgs E) { WebCamCast?.Stop(); AudioChat.Start(); WebCamCast = new WebCamCast(IPAddress.Parse(Ip.Text)); ScreenCastWindow scw = new ScreenCastWindow(); WebCamCast.OnFrameChange += (s) => { scw.Dispatcher.Invoke(() => { scw.ScreenCast_OnFrameChange(s); }); }; scw.Closed += Scw_Closed; scw.Show(); WebCamCast.ReceiveAsync(); }
private void ShareWebCam_OnClick(object Sender, RoutedEventArgs E) { IsWebCamCasting = !IsWebCamCasting; WebCamCast?.Stop(); if (IsWebCamCasting) { WebCamCast = new WebCamCast(IPAddress.Parse(Ip.Text)); AudioChat.Start(); WebCamCast.SendAsync(); ShareWebCam.Content = "Stop"; ReceiveWebCam.IsEnabled = false; } else { AudioChat.Stop(); ShareWebCam.Content = "Share WebCam"; ReceiveWebCam.IsEnabled = true; } }