title: Winform webBrowser's event don't fire
body: <p>I have the function to open a YouTube video and control them. it work fine on internet browser but the events, onPlayerReady and onPlayerStateChange, dont fire on web browser control. I'm using c# windows application.
  Any help please?</p>
  
  <pre><code>    webBrowser.ObjectForScripting = this;
      int w = workingArea.Width - 40;
      int h = workingArea.Height - 20;
      this.brwYoutubePlayer.Width = w + 2;
      this.brwYoutubePlayer.Height = h + 2;
  
      string VIDEO_ID = url.Substring(0, url.IndexOf("?"));
      VIDEO_ID = VIDEO_ID.Substring(VIDEO_ID.LastIndexOf("/") + 1);
      var embed = "&lt;html&gt;&lt;head&gt;" +
      "&lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge\"/&gt;" +
       "&lt;body scroll=\"no\" style=\"padding:0px;margin:0px;\"&gt;" +
       " &lt;script type='text/javascript' src='http://www.youtube.com/player_api'&gt;&lt;/script&gt;" +
       " &lt;iframe id=\"myPlayer\" width=\"{1}\" height=\"{2}\" src=\"{0}\" frameborder=\"0\" allowfullscreen&gt;&lt;/iframe&gt;" +
      "&lt;script type =\"text/javascript\"&gt;" +
      " var player; function onYouTubeIframeAPIReady(){{window.external.Test('Video start!!');" +
      " player = new YT.Player('myPlayer',{{" +
      " videoId : '" + VIDEO_ID + "'," +
      " events : {{'onReady' : onPlayerReady, 'onStateChange' : onPlayerStateChange}}}});}}"+
      "function onPlayerReady() {{window.external.Test('onPlayerReady'); }}" +
      " function onPlayerStateChange(evt){{window.external.Test('chenge status!!'); " +
      " if(evt.data==0){{ window.external.Test('Video finished!!');}}}}" +
      "&lt;/script&gt;" +
      "&lt;/body&gt;&lt;/html&gt;";
      webBrowser.DocumentText = string.Format(embed, url, w, h);
  </code></pre>