2017-07-27, 03:15
Hi there!
I've been working on an addon for a couple of months now that creates and manages dynamic playlists. You click a button in the addon, and it adds the episodes to the playlist.
What I've been trying to figure how is how to resume an episode on that playlist.
For example:
You've been watching the 5th episode in the playlist
You close Kodi and come back, and I've stored which episode you are on.
You click a button and it recreates that playlist and starts the 5th episode in that playlist, and it resumes where you were in that episode.
What I have working:
I can recreate the playlist, then start the 5th episode. But it won't resume. If I go to the playlist and manually start the episode it resumes fine, but not from my addon.
Here's the code I am currently using:
Here are the other things I've tried:
It seems like Playlist.PlayMedia has the ability to resume, but I can't figure out how to send it a playlist that isn't on the disk. I just want the currently loaded playlist.
Does anyone have any ideas? Thanks a ton!
I've been working on an addon for a couple of months now that creates and manages dynamic playlists. You click a button in the addon, and it adds the episodes to the playlist.
What I've been trying to figure how is how to resume an episode on that playlist.
For example:
You've been watching the 5th episode in the playlist
You close Kodi and come back, and I've stored which episode you are on.
You click a button and it recreates that playlist and starts the 5th episode in that playlist, and it resumes where you were in that episode.
What I have working:
I can recreate the playlist, then start the 5th episode. But it won't resume. If I go to the playlist and manually start the episode it resumes fine, but not from my addon.
Here's the code I am currently using:
Code:
xbmc.executebuiltin(
'Playlist.PlayOffset(%s,%d)' % ('Video', i)
)
Here are the other things I've tried:
Code:
# Get the playlist.
play = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
xbmc.executebuiltin(
'Playlist.PlayMedia(%s,resume, playoffset=%d)' % (play.getPlayListId(), i))
xbmc.Player().play(play[i].getfilename())
xbmc.Player().play(play, startpos=-1)
It seems like Playlist.PlayMedia has the ability to resume, but I can't figure out how to send it a playlist that isn't on the disk. I just want the currently loaded playlist.
Does anyone have any ideas? Thanks a ton!