title: C# windows media player event: when playlist has finished
body: <p>mp4 video files are in a folder. Files will change from time to time as new ones are added, old ones removed so it’s not a statis list. </p>
  
  <p>I’m reading the files in the folder at runtime and loading an array with the filenames to create a playlist.  At the end of the last file in the playlist I want to use the wmp “play state change” event to fire another event to continue with other tasks after the last vid ends. </p>
  
  <p>I can use the event successfully when I load the media player with individual files but it’s not behaving the same when a playlist is used.  It doesnt fire after the last video in the playlist finishes, Any ideas?  code below:</p>
  
  <pre><code> public void wmp_PlayStateChange_1(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
          {
              if (wmp.playState == WMPLib.WMPPlayState.wmppsStopped)
              {
                wmp.Visible = false;
                counter = 0;
                ImageTimer.Enabled = true;
                ImageTimer.Start();
              }
  
          }
  </code></pre>
  
  <p>Slight clarification:  If theres only ONE video file in the folder, it fires the event.  But if there's more than ONE, it does NOT fire the event at the end.  I can;t tell what if anything it fires but its not this specific event.  Thanks!</p>