|
-
Jan 5th, 2008, 02:16 PM
#1
Thread Starter
New Member
vb media player - next song automatically
Hi,
I am a quite experiences programmer and started coding a vb media player yesterday. Its basically done apart from i cant get the player to automatically load the next song. I have done a search of this forum but none of the previous responses seem to work.
Heres the code :
Private Sub WMP_StatusChange()
If WMP.playState = wmppsMediaEnded Then
If OptOn.Value = True Then
filecount = File1.ListCount
chosenfile = Int(Rnd * filecount) + 1 'generate random index
File1.Selected(chosenfile) = True
filename = Dir1.Path & "\" & File1.filename
WMP.URL = filename
Else
fileindex = File1.ListIndex
fileindex = fileindex + 1
File1.Selected(fileindex) = True 'plays next index
filename = Dir1.Path & "\" & File1.filename
WMP.URL = filename
End If
End If
End Sub
I have tried different events as well like playstatechange but no luck. The very annoying thing is that an identical piece of code works on a button click.
Any response would be appreciated
Thanks in advance
Juggler
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|