title: Cannot play any YouTube videos in C# WebBrowser
body: <p>I am developing a lightweight desktop application in C#.NET (Windows Forms) on Windows 7 64-bit that can search and play YouTube videos.</p>
  
  <p>I have spent the entire night and day trying to make the app play videos in all possible manners (I've tried WebBrowser and Shockwave ActiveX Control), and I haven't been able to play any video within the app, except if I force WebBrowser to navigate to the full YouTube video page through the URL <a href="https://www.youtube.com/watch?v=" rel="nofollow">https://www.youtube.com/watch?v=</a>{VIDEO_ID}.</p>
  
  <p>What I actually want is to be able to embed only the player itself in the WebBrowser, not the entire YT video page. Here is what I have tried so far:</p>
  
  <p><strong>Does work, but is not what I need:</strong> </p>
  
  <pre><code>WebBrowser.Navigate("https://www.youtube.com/watch?v=" + video.Id);
  </code></pre>
  
  <p><strong>Does not work:</strong></p>
  
  <pre><code>WebBrowser.Navigate("https://www.youtube.com/embed/" + video.Id);
  </code></pre>
  
  <hr>
  
  <pre><code>Browser.Navigate("about:blank");
  Browser.Document.OpenNew(true);
  
  Browser.DocumentText =
      "&lt;html&gt;&lt;body&gt;" +
          "&lt;iframe width='420' height='315' src='https://www.youtube.com/embed/" + video.Id + "&amp;html5=1' frameborder='0' allowfullscreen&gt;&lt;/iframe&gt;" +
      "&lt;/body&gt;&lt;/html&gt;";
  </code></pre>
  
  <hr>
  
  <pre><code>Browser.DocumentText = 
      "&lt;object width='640' height='390'&gt;" +
          "&lt;param name='movie' value='https://www.youtube.com/v/" + video.Id + "?version=3&amp;autoplay=1'&gt;&lt;/param&gt;" +
          "&lt;param name='allowScriptAccess' value='always'&gt;&lt;/param&gt;" +
          "&lt;embed src='https://www.youtube.com/v/" + video.Id + "?version=3&amp;autoplay=1' " +
              "type='application/x-shockwave-flash' allowscriptaccess='always' width='640' height='390'&gt;&lt;/embed&gt;" +
      "&lt;/object&gt;";
  </code></pre>
  
  <hr>
  
  <pre><code>AxShockwaveCtl.GotoMovie("https://www.youtube.com/v/" + video.Id);
  AxShockwaveCtl.Play();
  </code></pre>
  
  <hr>
  
  <pre><code>AxVideo.SRC = "https://www.youtube.com/v/" + video.Id;
  AxVideo.swURL = "https://www.youtube.com/v/" + video.Id;
  AxVideo.Play();
  </code></pre>
  
  <hr>
  
  <p>I believe I tried other stuff like WebBrowser.Document.Write as well, but nothing works. I have seen other questions here about this issue but they all seem to fix their problem in the end somehow, and I've tried to do what they did but in my case nothing works. Also tried changing all Internet Explorer settings. Everything works when I am on a "full" browser like IE 11 or Chrome, but my application just displays a black rectangle where the YouTube video should be.</p>