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

Similar threads

ops..
ops..
Hello everyone. I've been using the mediaportal tv server as backend and kodi as frontend from several, everything works regularly...
Replies
8
Views
356
There was no change obviously related to it, but maybe something as the fixed user management or similar made it.
There was no change obviously related to it, but maybe something as the fixed user management or similar made it.
Before you create this bug report: Make sure that your system (Windows, codecs and drivers) is up to date, matching the...
Replies
7
Views
783
Original please.
Original please.
While we are chatting, now get mad, you know that I said I would refactor the database to get rid of any redundancies. I've done...
Replies
290
Views
4K
This is not possible if it is a self made series, like personal travel videos etc.
This is not possible if it is a self made series, like personal travel videos etc.
Hi! I have videos that I want to show in TV-Series, such as personal TV series and educational series. As some examples I have...
Replies
8
Views
822
I'm US Eastern (-5 to -4 with DST). I also don't sleep normally, though, so when I'm up is anyone's guess. I got it to build a setup and install on my laptop. Now I can test skin stuff and really get my hands dirty. Nereus is gorgeous, but definitely not made for a mouse or touch screen. I've got some suggestions for it, but I'll put...
I'm US Eastern (-5 to -4 with DST). I also don't sleep normally, though, so when I'm up is anyone's guess. I got it to build a...
Okay, so I've spent the past day and a half on the wiki and forums. I've forked MediaPortal/MediaPortal-2, downloaded a ton of...
Replies
27
Views
2K
Top Bottom