0
votes
    private void mediaPlayer_Enter()
    {
        string path = Path.GetFullPath(currentTrack.Text);
        System.Diagnostics.Debug.WriteLine(path);
        mediaPlayer.URL = path;
        mediaPlayer.Ctlcontrols.play();
    }

This is the piece of code which is being called when the state of the media player turns to "media ended". I know that it does execute that line of code but it still doesn't play. It takes the item out of the listbox (which is the playlist) and loads it into the mediaPlayer but does not Automatically play the song. I have to press the button to start playing it - it has do play it stright away by itself. What am I doing wrong?

1
Windows Media Player, sorry.Maynn

1 Answers

0
votes

I believe this will autoplay your media: http://msdn.microsoft.com/en-us/library/windows/desktop/dd562405(v=vs.85).aspx

If the AxWindowsMediaPlayer.settings.autoStart property is true, playback begins automatically whenever you set currentMedia.