Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bcl
Channel Surfer

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
Channel Surfer

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
Channel Surfer

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
Visitor

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
Channel Surfer

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
Visitor

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