In the media player I have been making, I have created a auto load playlist, which then loades the next media file into the media player, but it wont play automatically, it just says Media opening.... I have tried using openstateChange, playstateChange, and other codes.
Here are the subs which work to load and play media files, keep in mind, if you select a file manually, then it DOES PLAY, when through the playstatechange Sub, it doesn't
Expand|Select|Wrap|Line Numbers
- Private Sub playlist_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles playlist.SelectedIndexChanged
- If Me.Visible = True Then Player.URL = playlist.SelectedItem
- ReturnValue = System.IO.Path.GetExtension(playlist.SelectedItem)
- Player.Ctlcontrols.play()
- Load_Music()
- Load_Video()
- End Sub
- Private Sub player_PlayStateChange(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles Player.PlayStateChange
- If Player.playState = WMPLib.WMPPlayState.wmppsMediaEnded Then playlist.SelectedIndex = playlist.SelectedIndex + 1
- PlayFile()
- End Sub
Signing off,
Swatmajor1