Example #1
0
        public MainWindow()
        {
            InitializeComponent();


            BrowserSettings browserSettings = new BrowserSettings();

            browserSettings.FileAccessFromFileUrls      = CefState.Enabled;
            browserSettings.UniversalAccessFromFileUrls = CefState.Enabled;
            browserSettings.BackgroundColor             = Colors.DarkGray.ToArgb();
            browser.BrowserSettings = browserSettings;

            clientProxy = new ClientAPIProxy();
            browser.JavascriptObjectRepository.Register("heyloClient", clientProxy, true);
            clientProxy.CommandIssued += ClientProxy_CommandIssued;;
        }
Example #2
0
        private void ClientProxy_CommandIssued(ClientAPIProxy proxy, ClientCommand command)
        {
            Dispatcher.Invoke(() =>
            {
                Storyboard sb;
                switch (command)
                {
                case ClientCommand.HeightIncrease:
                    sb = FindResource("IncreaseHeight") as Storyboard;
                    sb.Begin();
                    break;

                case ClientCommand.HeightDecrease:
                    sb = FindResource("DecreaseHeight") as Storyboard;
                    sb.Begin();
                    break;

                case ClientCommand.WidthIncrease:
                    sb = FindResource("IncreaseWidth") as Storyboard;
                    sb.Begin();
                    break;

                case ClientCommand.WidthDecrease:
                    sb = FindResource("DecreaseWidth") as Storyboard;
                    sb.Begin();
                    break;

                case ClientCommand.TurnOffCamera:
                    process.StandardInput.WriteLine("p");
                    process.StandardInput.Flush();
                    Console.WriteLine("TURN OFF CAMERA");
                    break;

                case ClientCommand.TurnOnCamera:
                    process.StandardInput.WriteLine("r");
                    process.StandardInput.Flush();
                    Console.WriteLine("TURN ON CAMERA");
                    break;
                }
            });
        }