home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Loading Current playlist, then Playing it
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="jburnette" data-source="post: 261204" data-attributes="member: 24356"><p>Not sure if you're still needing to know how to do this, but I found myself in the same situation with something I'm working on and think I've figured it out. Below is the code I use to add video files to a playlist and play them. Seems to work fine for me.</p><p></p><p>[CODE]</p><p>//create your player and then get your playlist to work with</p><p>MediaPortal.Playlists.PlayListPlayer plp = MediaPortal.Playlists.PlayListPlayer.SingletonPlayer;</p><p></p><p> MediaPortal.Playlists.PlayList playlist = plp.GetPlaylist(MediaPortal.Playlists.PlayListType.PLAYLIST_VIDEO);</p><p></p><p>//add your items</p><p> MediaPortal.Playlists.PlayListItem pli = new MediaPortal.Playlists.PlayListItem();</p><p> pli.FileName = file;</p><p> pli.Type = MediaPortal.Playlists.PlayListItem.PlayListItemType.Video;</p><p> pli.Description = file;</p><p> playlist.Add(pli);</p><p></p><p>//load the list shuffle if need be, then play</p><p> plp.CurrentPlaylistType = MediaPortal.Playlists.PlayListType.PLAYLIST_VIDEO;</p><p> playlist.Shuffle();</p><p> </p><p> plp.Play(0);</p><p></p><p></p><p></p><p></p><p>[/CODE]</p><p></p><p>Should be as simple as switching the type used to music.</p></blockquote><p></p>
[QUOTE="jburnette, post: 261204, member: 24356"] Not sure if you're still needing to know how to do this, but I found myself in the same situation with something I'm working on and think I've figured it out. Below is the code I use to add video files to a playlist and play them. Seems to work fine for me. [CODE] //create your player and then get your playlist to work with MediaPortal.Playlists.PlayListPlayer plp = MediaPortal.Playlists.PlayListPlayer.SingletonPlayer; MediaPortal.Playlists.PlayList playlist = plp.GetPlaylist(MediaPortal.Playlists.PlayListType.PLAYLIST_VIDEO); //add your items MediaPortal.Playlists.PlayListItem pli = new MediaPortal.Playlists.PlayListItem(); pli.FileName = file; pli.Type = MediaPortal.Playlists.PlayListItem.PlayListItemType.Video; pli.Description = file; playlist.Add(pli); //load the list shuffle if need be, then play plp.CurrentPlaylistType = MediaPortal.Playlists.PlayListType.PLAYLIST_VIDEO; playlist.Shuffle(); plp.Play(0); [/CODE] Should be as simple as switching the type used to music. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Loading Current playlist, then Playing it
Contact us
RSS
Top
Bottom