Is my add-on idea fairly easy? Am I on the right track?
#1
I plan to have a RPi in the car with external USB drive for the media files. I want it to remember what was playing and where it left off when power abruptly shuts off. I also want it to resume automatically at boot up. Yes, I know I'll have to keep a backup copy of my SD card for when it gets corrupted. I've never written an XBMC add-on before but here's my general idea for a service add-on.

When XBMC is running:
Every 30 seconds or so check if something is playing with xbmc.Player.isPlaying(). If it is then use Player.getPlayingFile() and Player.getTime() to know what's playing and where in the movie it is. Write that that information to the external USB drive.

At power on/startup:
Read from the file I saved when XBMC was running. Use Player.play(filename) to start playing it. Use Player.seekTime(...) to put it where we left off when the car last turned off.

Does this sound about right?

Thanks!

Reply
#2
Yes - I might be tempted to store the file path and resume time in the server settings (rather than an external file - keeps things simple, easier to access and a standard interface - plus would give you the easy ability to reset/alter it) and use setresolvedurl to play it back.

Also, you don't need to use player.seek, as you can feed a resume time directly into the setresolvedurl call.
Add-on:PleXBMC (wiki) - Play Plex media through XBMC
PleXBMC Helper - Integrate Official/Unoffical Plex remote control apps into PleXBMC
PleXBMC Repository - install and manage all PleXBMC addons
Quartz3 PleXBMC - Integrate PleXBMC into home menus
Reply
#3
Thanks for the info! I was trying to avoid writes to the SD card so when the power gets cut off, less chance of corruption.
Reply

Logout Mark Read Team Forum Stats Members Help
Is my add-on idea fairly easy? Am I on the right track?0