title: Windows Media Player Duration - WinForms
body: <p>I am trying to get the Duration of the video that i have loaded into my Windows Media Player but it seems to be returning back '0.0'</p>
  
  <p>I need the duration value before the video starts playing as the video length determines the width of a slide.</p>
  
  <p>This is how i am trying to do it at the moment:</p>
  
  <pre><code>timeElapsed = AxWindowsMediaPlayer_OnDemand.currentMedia.duration - marker.SyncTime
  </code></pre>
  
  <p>I have also tried this which returns an empty string:</p>
  
  <pre><code>Dim asas As String = AxWindowsMediaPlayer_OnDemand.currentMedia.getItemInfo("Duration")
  </code></pre>
  
  <p>Does anyone have any idea of how to get the length of the video loaded in?</p>