Solved Start from beginning doesn't work
#1
I've been developing a video plugin with syncing resume points across devices. I get a resume point from the server and then I set it with:
python:
xbmcgui.ListItem.setProperty("resumetime", "some_seconds")
xbmcgui.ListItem.setProperty("totaltime", "some_seconds")
When I click on a list item the context menu appears with two choices: "Resume from ..." and "Start from beginning". Resume works fine, but start from beginning doesn't. It always starts from the resume point. Is it a bug in Kodi or I do something wrong? How to fix that issue? The sources of the addon is here https://github.com/quarckster/kodi.kino.pub.
Reply
#2
Maybe connected...
https://forum.kodi.tv/showthread.php?tid=336638
Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
Reply
#3
Neither "StartPercent" nor "StartOffset" don't set the resume time for me.
Reply
#4
i've tested it with a very basic plugin and 'start from beginning' works fine for me.
python:
import sys
import xbmcgui
import xbmcplugin

addon_handle = int(sys.argv[1])
url = '/home/ronie/videos/mymovie.mp4'

li = xbmcgui.ListItem('My Movie')
li.setProperty('totaltime', '800')
li.setProperty('resumetime', '200')

xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li)
xbmcplugin.endOfDirectory(addon_handle)
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
I fixed the issue in my plugin. I found out that you don't need to set resume time and do any setInfo call for a list item in a function where you call xbmcplugin.setResolvedUrl. Basically you should do something like this:

python:
def list_items():
    li = xbmcgui.ListItem('My Movie')
    li.setProperty('totaltime', '800')
    li.setProperty('resumetime', '200')
    #  url leads to "play" function
    xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li)
    xbmcplugin.endOfDirectory(addon_handle)

def play():
    li = xbmcgui.ListItem('My Movie', path=url)
    xbmcplugin.setResolvedUrl(request.handle, True, li)
 
I would say it's unobvious behavior. A list item in play function doesn't contain any information about resume time, but neveretheless it will be automagically played from the correct point. Thanks everyone. The thread can be closed as resolved.
Reply

Logout Mark Read Team Forum Stats Members Help
Start from beginning doesn't work0