Tracking Video Position at Pause/Stops

Discuss issues related to PS3 Media Server development (only for programmers)

Tracking Video Position at Pause/Stops

Postby omizzle » Mon Feb 28, 2011 7:32 pm

hi all,

i've been using the PS3 media server with good results and wanted to fiddle with the source. in particular, what i find quite frustrating is when i'm watching a movie, and for whatever reason need to stop for the day, and then return, only to have to fast forward to the place where i last stopped. similar to most dvd players, i'd like the system to remember where i last stopped a video and resume from there.

so i started looking at the code, and when a resource begins playing is quite clear. in fact, i noticed a StartStopListener and this seems like the right place to go. but, i wanted to understand when "stop" is called, and if there's any ability to identify the frame number or video position/time when stop is called. namely, if the user pauses or terminates their playback, will "stop" be called and can timing information be extracted? from what i can tell, the timing information on the server side is quite approximate (it looks like data is just streamed, and the receiver (i.e. the PS3) keeps track of time).

is my cursory analysis correct? if someone who has worked with the code knows how to proceed on this type of feature, a brief run-down would be helpful, then i could do the work. a little task like this seems a good way to dive into the source.


Posts: 1
Joined: Mon Feb 28, 2011 7:21 pm

Re: Tracking Video Position at Pause/Stops

Postby taconaut » Tue Mar 01, 2011 7:38 am

Hi Omar,

The StartStopListener notifications are a bit buggy, meaning notifications are being done when they shouldn't (e.g. when showing folder content), but it can be used with some tweaks.
I can offer the first part of what you want to do; where the play length can be stored. In my pms-mlx modification there's a PlayCountWatcherPlugin, which stores a play count if the played file stops after 80% or more of its total play length. It's not working all, but most of the time.
I'd recommend giving this plugin a go for you to see how the start/stop methods are being called. You'll have to set log level to DEBUG for the plugin.
For the second part, where you'll have to set the start time for the beginning of the stream, I can't really help out.

If you want to add the functionality through pms-mlx (there's already a db with a playcounts table that would need another column with e.g. a boolean hasfinishedplaying) I'd be happy to add it to the build.
If you always wanted to have your most recent videos at the top of the folder in the ps3 or wished you could group all videos with the same genre in one folder, have a look at pms-mlx
Project Member
Posts: 1073
Joined: Sat Apr 11, 2009 12:29 am
Location: Switzerland

Return to Developers

Who is online

Users browsing this forum: No registered users and 2 guests