Hi Idle_Mind, your idea is good, many thanks.
However I still have a problem of looping/repeating the playlist. Similar problem as I cant detect when the playlist ends, or is there a way? My objective is to loop all the movies automatically.
I have modified the codes a little including making it play in full screen. Noticed a microsoft bug which needed the full screen code to execute after a short delay.
Public Sub PlayFile()
Dim i As Integer
Dim path As String
path = "C:\temp\ADVERTISEMENT\"
Dim Playlist As IWMPPlaylist
Dim fsoSysObj As Scripting.FileSystemObject
Set fsoSysObj = New Scripting.FileSystemObject
Dim fdrFolder As Scripting.Folder
Dim filFile As Scripting.File
Set fdrFolder = fsoSysObj.GetFolder(path)
Set Playlist = WindowsMediaPlayer1.newPla
For i = 1 To fdrFolder.Files.Count
'Validation needed.
Playlist.appendItem WindowsMediaPlayer1.newMed
Next
WindowsMediaPlayer1.curren
WindowsMediaPlayer1.Contro
subDelay (1)
WindowsMediaPlayer1.fullSc
End Sub
Main Topics
Browse All Topics





by: Idle_MindPosted on 2007-06-25 at 21:31:03ID: 19360953
You could build yourself a PlayList and then press Play.
ylist("MyP layList", "") ia(path & "Ad" & i & ".wmv") tPlaylist = Playlist ls.play
This worked for me using WMP10:
Private Sub Form_Load()
Dim i As Integer
Dim path As String
Dim Playlist As IWMPPlaylist
path = "C:\temp\ADVERTISEMENT\"
Set Playlist = WindowsMediaPlayer1.newPla
For i = 1 to 3
Playlist.appendItem WindowsMediaPlayer1.newMed
Next
WindowsMediaPlayer1.curren
WindowsMediaPlayer1.Contro
End Sub