Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bcl
Level 7

Using Registry for Last played position

I'm whacking away at v2.0 of Home Media Server this weekend. I've got it to the point where browsing the server works and video playback is working. This rewrite is focusing on minimal server dependencies (in other words all you need is a http server with range header support and directory listing support). So I'd like to be able to keep track of the last position locally. Does the registry have enough space for something like this? Index using the video filename (no path) and last position reported before exiting (I'd only be saving on exit, not while playing).

Code isn't available yet, I've got some cleanup to do before I push it up to the git repository, hopefully by Sunday.
0 Kudos
5 REPLIES 5\
TheEndless
Level 9

Re: Using Registry for Last played position

You can store up to 16k in the registry per dev key.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
bcl
Level 7

Re: Using Registry for Last played position

Thanks. I expect that won't be enough to store everything. I suppose I could limit it to the last 10 or so movies watched. I really want to avoid any kind of external dependency.
0 Kudos
gonzotek
Level 8

Re: Using Registry for Last played position

"bcl" wrote:
Thanks. I expect that won't be enough to store everything. I suppose I could limit it to the last 10 or so movies watched. I really want to avoid any kind of external dependency.
You could probably store a hash of the movie url instead of the complete url to save some space. Also, I think you have to periodically update the last played position while playing, because Roku changed the home key behavior so that it forces apps to close without a trappable event. See here:
viewtopic.php?p=182789#p182789
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
bcl
Level 7

Re: Using Registry for Last played position

"gonzotek" wrote:
"bcl" wrote:
Thanks. I expect that won't be enough to store everything. I suppose I could limit it to the last 10 or so movies watched. I really want to avoid any kind of external dependency.
You could probably store a hash of the movie url instead of the complete url to save some space. Also, I think you have to periodically update the last played position while playing, because Roku changed the home key behavior so that it forces apps to close without a trappable event. See here:
viewtopic.php?p=182789#p182789


Good point, I remember seeing that now. I probably won't handle that case, no sense in prematurely wearing out the flash. Save on 'normal' exit should cover most cases.
0 Kudos
kbenson
Level 7

Re: Using Registry for Last played position

"bcl" wrote:
So I'd like to be able to keep track of the last position locally. Does the registry have enough space for something like this? Index using the video filename (no path) and last position reported before exiting (I'd only be saving on exit, not while playing).


How many are you planning on saving? I'm thinking you can save quite a few in the space you have.

A few options:

  • If you have well defined sources, you can pull the common part of the source out into a separate table, and just reference that. E.g. if source "1" is defined, prepend that source's base URL to the file specified. You have to store the source's in the registry as well, but you keep the ability to reference full path names.

  • If you are JUST tracking playback position, remove the entire entry when the entire move is watched, or they are X seconds from the end, similar to Netflix. That saves a lot of space.

  • If you store a timestamp for the most recent change of the data in each record, you can scan and remove the oldest entries when space becomes sparse.


Each of these has a fairly easy to identify tradeoff of space for complexity, so obviously pick which ones make sense for you (if any) based on your needs.
-- GandK Labs
Check out Reversi! in the channel store!
0 Kudos