Beispiel #1
0
        public static void Main()
        {
            try
            {
                using (IEngine engine = EngineFactory.Create(new EngineOptions.Builder().Build()))
                {
                    Console.WriteLine("Engine created");

                    using (IBrowser browser = engine.CreateBrowser())
                    {
                        Console.WriteLine("Browser created");

                        IMediaDevices mediaDevices = engine.MediaDevices;
                        Console.WriteLine("\nAvailable audio capture devices:");
                        PrintDevices(mediaDevices.AudioCaptureDevices);
                        Console.WriteLine("\nAvailable video capture devices:");
                        PrintDevices(mediaDevices.VideoCaptureDevices);

                        mediaDevices.SelectMediaDeviceHandler =
                            new Handler <SelectMediaDeviceParameters, SelectMediaDeviceResponse>(SelectDevice);

                        browser.Navigation.LoadUrl("https://alexandre.alapetite.fr/doc-alex/html5-webcam/index.en.html")
                        .Wait();
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to terminate...");
            Console.ReadKey();
        }
Beispiel #2
0
        public LocalMediaStream(IWebRtcMiddleware webRtcMiddleware, IJSRuntime jsRuntime = null)
        {
            var window    = webRtcMiddleware.WebRtc.Window(jsRuntime);
            var navigator = window.Navigator();

            _mediaDevices = navigator.MediaDevices;
        }
Beispiel #3
0
        public MediaStreamService(IJSRuntime jsRuntime = null)
        {
            var window    = WebRtcMiddleware.WebRtc.Window(jsRuntime);
            var navigator = window.Navigator();

            _mediaDevices = navigator.MediaDevices;
        }