MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Community Skins and Plugins » Plugins


Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here.

Reply
 
Thread Tools Display Modes
Old 2008-02-22, 23:19   #1 (permalink)
Portal Member
 
Join Date: Aug 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts


Default playback stops after first file in playlist

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);
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();
        }
greez
JunkiXL

Last edited by junkixl; 2008-02-23 at 01:38. Reason: Automerged Doublepost
junkixl is offline   Reply With Quote
Reply

Bookmarks

Tags
playback, playlist, stops

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Playlist error from Syntax M3U playlist file Luccio Support 9 2008-10-07 00:38
TV playback freezes, stops B_J General Support 0 2007-12-06 21:35
Video playback stops after a few seconds kgprodigy Support 0 2007-05-21 11:52
Removing a track, occuring double in playlist, removes both and stops music idioteque 0.2.0.0 Final and SVN Builds 2 2006-12-11 21:22
Playback stops on DVD NorthernJohn Codecs, External Players 4 2006-03-21 00:34


All times are GMT +1. The time now is 05:01.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden