Example #1
0
        /// <summary>
        /// This will set the Player Browser to a URL
        /// </summary>
        public void SetPlayer(string url)
        {
            player = new ChromeDriver();
            player.Manage().Window.Size = new System.Drawing.Size(300,300);
            player.Navigate().GoToUrl(url);
            //This code clicks the play button automatically through Java Script injection
            
            player.ExecuteJavascript("$(\"#ad_block_0\").remove();");
            player.ExecuteJavascript("var embed = document.getElementById(\"player\"); embed.Play(); ");
            //player.ExecuteJavascript("var ele = document.getElementById(\"player\"); ele.dispatchEvent(new MouseEvent(MouseEvent.CLICK, true, false));");

            if (timeChecker == null)
            {
                timeChecker = new Thread(() => { CheckTime(); });
                timeChecker.Start();
            }
        }
Example #2
0
 /// <summary>
 /// This will set the Player Browser to a URL
 /// </summary>
 public void SetPlayer(string url)
 {
     player = new ChromeDriver();
     
     player.Navigate().GoToUrl(url);
     //This code clicks the play button automatically through Java Script injection
     player.ExecuteJavascript("document.getElementsByClassName('vjs-big-play-button')[0].click();");
     
     if (timeChecker == null)
     {
         timeChecker = new Thread(() => { CheckTime(); });
         timeChecker.Start();
     }
 }