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
playback stops after first file in playlist
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="junkixl" data-source="post: 237820" data-attributes="member: 54963"><p>Hi,</p><p></p><p>I'm writing my first plugin at the moment. I have information about movies in a mySQL database (movieinfo, where and how much files belong to the movie and so on). this plugin simply shows a list of movies which can be generated throug an SQL statement. after clicking on a movieentry, the plugin generates a videoplaylist with all the files belonging to that one movie and starts playing (it's like the myvideo plugin). and there's my problem: I can create the playlist, but if i playback the list, it stops after the first file and won't continue with the next on in the list.</p><p>Here's what I got so far:</p><p>[CODE]PlayListPlayer player = new PlayListPlayer() ;</p><p> DataTable files = new DataTable();</p><p></p><p> player.Reset();</p><p> player.CurrentPlaylistType = PlayListType.PLAYLIST_VIDEO_TEMP;</p><p> PlayList playlist = player.GetPlaylist(PlayListType.PLAYLIST_VIDEO_TEMP);</p><p> playlist.Clear();</p><p></p><p> files = SqlQuery("SELECT * FROM dateien WHERE movie_id = " + data.Rows[curListSelection]["id"].ToString(), files);</p><p></p><p> for (int i = 0; i < files.Rows.Count; i++)</p><p> {</p><p> PlayListItem item = new PlayListItem();</p><p> item.FileName = files.Rows[i]["gspot_file_name_with_path"].ToString();</p><p> item.Type = PlayListItem.PlayListItemType.Video;</p><p> playlist.Add(item);</p><p> }</p><p></p><p> playlist.Sort();</p><p> player.Play(0);[/CODE]</p><p></p><p>I was looking for a method in the playlist-object where I can set how to behave when a file comes to an end. but it seems that such a method doesn't exist.</p><p></p><p>any idea how to solve that?</p><p></p><p>greez</p><p>JunkiXL</p><p></p><p>Ok, I found a quick and dirty fix, but I'm still searching for a more straight forward solution. </p><p>for everyone who has the same trouble, just add an g_Player eventhandler as shown below</p><p></p><p>[CODE]</p><p>protected override void OnPageLoad()</p><p>{</p><p> .....</p><p> g_Player.PlayBackEnded += new g_Player.EndedHandler(g_Player_PlayBackEnded);</p><p>}</p><p>void g_Player_PlayBackEnded(g_Player.MediaType type, string filename)</p><p> {</p><p> player.PlayNext();</p><p> }</p><p>[/CODE]</p><p></p><p>greez</p><p>JunkiXL</p></blockquote><p></p>
[QUOTE="junkixl, post: 237820, member: 54963"] Hi, I'm writing my first plugin at the moment. I have information about movies in a mySQL database (movieinfo, where and how much files belong to the movie and so on). this plugin simply shows a list of movies which can be generated throug an SQL statement. after clicking on a movieentry, the plugin generates a videoplaylist with all the files belonging to that one movie and starts playing (it's like the myvideo plugin). and there's my problem: I can create the playlist, but if i playback the list, it stops after the first file and won't continue with the next on in the list. Here's what I got so far: [CODE]PlayListPlayer player = new PlayListPlayer() ; DataTable files = new DataTable(); player.Reset(); player.CurrentPlaylistType = PlayListType.PLAYLIST_VIDEO_TEMP; PlayList playlist = player.GetPlaylist(PlayListType.PLAYLIST_VIDEO_TEMP); playlist.Clear(); files = SqlQuery("SELECT * FROM dateien WHERE movie_id = " + data.Rows[curListSelection]["id"].ToString(), files); for (int i = 0; i < files.Rows.Count; i++) { PlayListItem item = new PlayListItem(); item.FileName = files.Rows[i]["gspot_file_name_with_path"].ToString(); item.Type = PlayListItem.PlayListItemType.Video; playlist.Add(item); } playlist.Sort(); player.Play(0);[/CODE] I was looking for a method in the playlist-object where I can set how to behave when a file comes to an end. but it seems that such a method doesn't exist. any idea how to solve that? greez JunkiXL Ok, I found a quick and dirty fix, but I'm still searching for a more straight forward solution. for everyone who has the same trouble, just add an g_Player eventhandler as shown below [CODE] protected override void OnPageLoad() { ..... g_Player.PlayBackEnded += new g_Player.EndedHandler(g_Player_PlayBackEnded); } void g_Player_PlayBackEnded(g_Player.MediaType type, string filename) { player.PlayNext(); } [/CODE] greez JunkiXL [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
playback stops after first file in playlist
Contact us
RSS
Top
Bottom