xbmcgui.ListItem: how to prompt user to either resume or start at the beginning?
#1
Given a xbmcgui.ListItem, what properties do I need to set (or to NOT set) in order to let Kodi prompt the user whether he'd like to continue watching. Using code from script.module.metadatautils and setting

python:

listitem.setProperty("resumetime") = str(<seconds>)
listitem.setProperty("totaltime") = str(<seconds>)
listitem.setProperty("StartOffset") = str(<seconds>)

DOES show the listitem as partially watched. However, Kodi does not prompt the user for resume, but always starts the video at the beginning.
Reply
#2
Does this happen when you play from library too? The only time I saw this with Emby for Kodi was for widget playback.
Reply
#3
Yes, happens from the library too. Did not even try widgets. 

Kodi DOES ask whether the user wants to resume if the listitem has been synched to the Kodi library. If the item has not been synched, Kodi does not ask.
Reply
#4
Maybe a video needs to have an entry in the Kodi video database table "bookmarks" - otherwise Kodi will never prompt whether the user wants to resume?
Reply
#5
I don't think so, I have tested here. Deleted entries from the database and plugin listing still prompts for resume.

Have you tried using the property StartPercent instead of StartOffset, which does not work with Leia? Maybe it makes a difference?
( resume time / runtime ) * 100 ?

Edit: Do you also define those?
python:

listitem.setProperty('IsPlayable', 'true')
listitem.setProperty('IsFolder', 'false')
Reply
#6
Unfortunately, this does not make a difference in any combination.
Reply
#7
Pah, it wasn't a xbmcgui.ListItem issue at all. If the Kodi "Default select action" is "Show information", Kodi will not ask the user whether he'd like to resume. Same if you have "Play" as action, but show the information screen for the list item, then choose to play. 

Thanks for the help anyway, angelblue  Blush
Reply
#8
Makes sense! I had never noticed that behavior in combination with listitems.
Reply

Logout Mark Read Team Forum Stats Members Help
xbmcgui.ListItem: how to prompt user to either resume or start at the beginning?0