2013-01-14, 01:14
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!
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!