title: Playing video files on a panel
body: <p>I am trying to play a video file on a panel. I located a sample code from <a href="https://social.msdn.microsoft.com/Forums/en-US/caf245b9-a7f9-42b1-9276-f8dfc1e21591/playing-a-midi-file?forum=Vsexpressvb" rel="nofollow">social.msdn forum</a> but the download links to directx redistributable &amp; SDK update mentioned on the sample code is broken. Therefore I manually searched for directx 9.0C and installed it from <a href="http://www.microsoft.com/en-us/download/details.aspx?id=34429" rel="nofollow">this link</a>. And below is the code that I used.</p>
  
  <pre><code>Imports Microsoft.DirectX.AudioVideoPlayback
  
  Dim videoFile As Video = New Video("G:/Shared Data/myvid-2012.avi")
  videoFile.Owner = Panel1
  videoFile.Play()
  </code></pre>
  
  <p>I had to manually browse &amp; add the reference of <code>Microsoft.DirectX.AudioVideoPlayback</code>.</p>
  
  <p>The above code is in the form load event. Now when I try to run the application it sometimes holds forever without opening my app. And sometimes it does open up but my panel doesn't show up the video. Is there a solution to this problem ?</p>