public void StartLocalMedia(VideoPage videoWindow, Action<string> callback) { LocalMedia = new LocalMedia(); LocalMedia.Start(videoWindow, callback); }
public void StartLocalMedia(VideoPage videoWindow, Action <string> callback) { LocalMedia = new LocalMedia(); LocalMedia.Start(videoWindow, callback); }
public void Start(VideoPage videoPage, Action <string> callback) { // WebRTC audio and video streams require us to first get access to // the local media (microphone, camera, or both). UserMedia.GetMedia(new GetMediaArgs(Audio, Video) { // Specify an audio capture provider, a video // capture provider, an audio render provider, // and a video render provider. The IceLink // SDK comes bundled with video support for // WinForms and WPF, and uses NAudio for audio // support. For lower latency audio, use ASIO. AudioCaptureProvider = new AudioCaptureProvider(), VideoCaptureProvider = new VideoCaptureProvider(videoPage), CreateAudioRenderProvider = (e) => { return(new AudioRenderProvider()); }, CreateVideoRenderProvider = (e) => { return(new Direct3DRenderProvider()); }, VideoWidth = VideoWidth, // optional VideoHeight = VideoHeight, // optional VideoFrameRate = VideoFrameRate, // optional OnFailure = (e) => { callback(string.Format("Could not get media. {0}", e.Exception.Message)); }, OnSuccess = (ea) => { // We have successfully acquired access to the local // audio/video device! Grab a reference to the media. // Internally, it maintains access to the local audio // and video feeds coming from the device hardware. LocalMediaStream = ea.LocalStream; // This is our local video control, a WinForms Control or // WPF FrameworkElement. It is constantly updated with // our live video feed since we requested video above. // Add it directly to the UI or use the IceLink layout // manager, which we do below. LocalVideoControl = (FrameworkElement)ea.LocalVideoControl; // Create an IceLink layout manager, which makes the task // of arranging video controls easy. Give it a reference // to a WinForms control that can be filled with video feeds. // For WPF users, the WebRTC extension includes // WpfLayoutManager, which accepts a Canvas. LayoutManager = new WpfLayoutManager(videoPage.Container); // Position and display the local video control on-screen // by passing it to the layout manager created above. LayoutManager.SetLocalVideoControl(LocalVideoControl); // When double-clicked, mute/unmute the local video. videoPage.Dispatcher.BeginInvoke(() => { LocalVideoControl.DoubleTap += (sender, ce) => { LocalMediaStream.ToggleVideoMute(); }; }); //call back of null will let the app know to continue on to the signalling stage callback(null); } }); }
public void Start(VideoPage videoPage, Action<string> callback) { // WebRTC audio and video streams require us to first get access to // the local media (microphone, camera, or both). UserMedia.GetMedia(new GetMediaArgs(Audio, Video) { // Specify an audio capture provider, a video // capture provider, an audio render provider, // and a video render provider. The IceLink // SDK comes bundled with video support for // WinForms and WPF, and uses NAudio for audio // support. For lower latency audio, use ASIO. AudioCaptureProvider = new AudioCaptureProvider(), VideoCaptureProvider = new VideoCaptureProvider(videoPage), CreateAudioRenderProvider = (e) => { return new AudioRenderProvider(); }, CreateVideoRenderProvider = (e) => { return new Direct3DRenderProvider(); }, VideoWidth = VideoWidth, // optional VideoHeight = VideoHeight, // optional VideoFrameRate = VideoFrameRate, // optional OnFailure = (e) => { callback(string.Format("Could not get media. {0}", e.Exception.Message)); }, OnSuccess = (ea) => { // We have successfully acquired access to the local // audio/video device! Grab a reference to the media. // Internally, it maintains access to the local audio // and video feeds coming from the device hardware. LocalMediaStream = ea.LocalStream; // This is our local video control, a WinForms Control or // WPF FrameworkElement. It is constantly updated with // our live video feed since we requested video above. // Add it directly to the UI or use the IceLink layout // manager, which we do below. LocalVideoControl = (FrameworkElement)ea.LocalVideoControl; // Create an IceLink layout manager, which makes the task // of arranging video controls easy. Give it a reference // to a WinForms control that can be filled with video feeds. // For WPF users, the WebRTC extension includes // WpfLayoutManager, which accepts a Canvas. LayoutManager = new WpfLayoutManager(videoPage.Container); // Position and display the local video control on-screen // by passing it to the layout manager created above. LayoutManager.SetLocalVideoControl(LocalVideoControl); // When double-clicked, mute/unmute the local video. videoPage.Dispatcher.BeginInvoke(() => { LocalVideoControl.DoubleTap += (sender, ce) => { LocalMediaStream.ToggleVideoMute(); }; }); //call back of null will let the app know to continue on to the signalling stage callback(null); } }); }