noob - filling and starting a playlist on the fly (1 Viewer)

ghackett

Portal Member
May 9, 2005
30
0
NYC
Hi all, I've recieved lots of help so far, but I've got 1 more question. I have and array of strings which are file names of video files, that are generated on the fly within the plugin. My question is how can I get the current playlist, clear it, add the files in my array to it, and start it in full screen. I think this should be a pretty simple procedure, but I'm having trouble figuring it out. So if anyone can help me with a function to do this it would be greatly appreiated.

My array is defined as
Code:
Dim fileNames() As String
and filled automatically.

P.S. I am writing my plugin in VB, but I can translate pretty well from C#, so any help at all would be appreciated.

Thanks a lot!
 

ghackett

Portal Member
May 9, 2005
30
0
NYC
I'm sorry guys, once again I have mastered the art of asking a question 20 minutes before I figure out the answer. I know this is probably getting annoying and I really do apologize. For futre reference for any noobs that might be searching, the following code will clear the current playlist and add the video files referenced in the arr() array to the current playlist, shuffle it, and start playing it.
Code:
            MediaPortal.Playlists.PlayListPlayer.Reset()
            MediaPortal.Playlists.PlayListPlayer.CurrentPlaylist = MediaPortal.Playlists.PlayListPlayer.PlayListType.PLAYLIST_VIDEO_TEMP
            Dim mpPl As MediaPortal.Playlists.PlayList = MediaPortal.Playlists.PlayListPlayer.GetPlaylist(MediaPortal.Playlists.PlayListPlayer.PlayListType.PLAYLIST_VIDEO_TEMP)
            mpPl.Clear()

            Dim i As Int32 = 0
            For i = 0 To arr.Length - 1
                Dim newItem As New MediaPortal.Playlists.PlayList.PlayListItem
                newItem.FileName = arr(i)
                newItem.Type = MediaPortal.Playlists.PlayList.PlayListItem.PlayListItemType.Video
                mpPl.Add(newItem)
            Next
            mpPl.Shuffle()
            MediaPortal.Playlists.PlayListPlayer.PlayNext(True)
 

Users who are viewing this thread

Top Bottom