title: Windows Media Player in ASP.NET C#
body: <p>First attempt at this: I created the Windows Media Player programmatically by adding the WMPLib as a reference in my project. I am trying to play a playlist using Windows Media Player in a ASP.Net web page (Visual Studio 2015). I cannot use the video tag used in examples for HTML 5 as I need to display .wmv, .mp4, .jpg formats in the control. When I run the code, no errors are displayed and I see an empty browser, what am I missing?
  Here is my sample code:</p>
  
  <pre><code>    WMPLib.WindowsMediaPlayer Player;
  
      protected void Page_Load(object sender, EventArgs e)
      {
          FileNames();            
      }
  
      public void FileNames()
      {
          String[] extentions = { "*.wmv", "*.mp4", "*.jpg" };
          List&lt;string&gt; files = new List&lt;string&gt;();
          foreach (string filter in extentions)
          {
              files.AddRange(System.IO.Directory.GetFiles(@"C:\Documents\", filter));
          }   
  
          foreach (string ss in files)
          {
              String name = System.IO.Path.GetFileName(ss);
              Player = new WMPLib.WindowsMediaPlayer();
  
              WMPLib.IWMPPlaylist playList = Player.newPlaylist("myPlayList", "");
              playList.appendItem(Player.newMedia(name));
              Player.currentPlaylist = playList;
              Player.controls.play();
          }
      }
  </code></pre>
  
  <p>I am aware of the hard coded path which is not good practice, however I just need to get this displaying on my local machine.
  Thanks! </p>