Results 1 to 2 of 2

Thread: [RESOLVED] Play all songs (Resolved)

Threaded View

  1. #1

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Resolved [RESOLVED] Play all songs (Resolved)

    Hi,

    I'm using the Windows mediaplayer control to play mp3s but I can't get it to play songs in a list. This is the code I'm using:

    VB Code:
    1. Private Sub MediaPlayer1_EndOfStream(ByVal Result As Long)
    2. frmSetup.Lstsongs.ListIndex = frmSetup.Lstsongs.ListIndex + 1
    3. MediaPlayer1.FileName = frmSetup.Lstsongs.Text
    4. MediaPlayer1.Play
    5. End Sub
    6.  
    7. Function Play()
    8. 'If cancel then close the program
    9. 'Else choose and play a song
    10. On Error Resume Next
    11. Music1.ShowOpen
    12. If Err.Number = "32755" Then
    13. MediaPlayer1.Stop
    14. Unload Me
    15. End If
    16. If frmSetup.Songopt(0).Value = True Then
    17. MediaPlayer1.FileName = Music1.FileTitle
    18. MediaPlayer1.Play
    19. mnuPlay.Checked = True
    20. End If
    21. If frmSetup.Songopt(1).Value = True Then
    22. frmSetup.Lstsongs.AddItem Music1.FileName
    23.  x = MsgBox("Do you want to add more songs?", vbYesNo)
    24. If x = vbYes Then
    25. Music1.ShowOpen
    26. frmSetup.Lstsongs.AddItem Music1.FileName
    27. ElseIf x = vbNo Then
    28. MediaPlayer1.FileName = frmSetup.Lstsongs.Text
    29. MediaPlayer1.Play
    30. End If
    31. End If
    32. End Function

    It plays the first song then goes straight to the last song skipping all the songs in between.

    TIA

    NW
    Last edited by Nightwalker83; Dec 25th, 2002 at 05:19 AM.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width