(2024-12-30, 14:08)rysson Wrote: It's not a timeout or something. There is a race. Sometime Kodi try to start video sometime not (stops before start). Never mind.
Summarize:setResolvedUrl(success=False)
– the best way but annoying
- resolve with empty list if starts from begging
- resolve with long-long-video if resume and stop immediately – can blink single frame (if AVStart is fast enough).
Thanks for your help.
P.S. I don't know how to mark the thread as "solved".
I have the same issue with my addon, pasting my request from a different thread, as I think the issue is the same:
My situation. I have
an addon that executes a custom script (launches a game) when a listitem is selected, rather than play's media.
When the user selects the listitem directly, my addon has no problem routing the selection of the listitem to execute the correct script for that listitem. As an example, here's what the logs show when the user selects the listitem directly:
xml:
debug <general>: CPythonInvoker(23): adding args:
debug <general>: CPythonInvoker(23): plugin://plugin.program.iagl/play_game/e09ca05cf0b8946dc8c4d5b544bf80d0
debug <general>: CPythonInvoker(23): -1
debug <general>: CPythonInvoker(23):
debug <general>: CPythonInvoker(23): resume:false
..
debug <general>: [plugin.program.iagl][routing] Dispatching to 'play_game_external', args: {'game_id': 'e09ca05cf0b8946dc8c4d5b544bf80d0'}
debug <general>: IAGL Route: /play_game_external/e09ca05cf0b8946dc8c4d5b544bf80d0
...
info <general>: IAGL: Playing game XYZ
However, if the user brings up the info dialog window for that listitem, and they select the 'Play' button (using Estuary as the default skin), the script still executes as before and succeeds, but now theres a dialog window stating "Playback Failed: One more items failed to play. Check log for more information about this message."
The log looks exactly the same as before, but now there are two errors regarding playlist player being unable to play an item
xml:
debug <general>: CPythonInvoker(23): adding args:
debug <general>: CPythonInvoker(23): plugin://plugin.program.iagl/play_game/e09ca05cf0b8946dc8c4d5b544bf80d0
debug <general>: CPythonInvoker(23): -1
debug <general>: CPythonInvoker(23):
debug <general>: CPythonInvoker(23): resume:false
..
**error <general>: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.program.iagl/play_game/e09ca05cf0b8946dc8c4d5b544bf80d0]
debug <general>: [plugin.program.iagl][routing] Dispatching to 'play_game_external', args: {'game_id': 'e09ca05cf0b8946dc8c4d5b544bf80d0'}
debug <general>: IAGL Route: /play_game_external/e09ca05cf0b8946dc8c4d5b544bf80d0
**debug <general>: Playlist Player: no more playable items... aborting playback
...
info <general>: IAGL: Playing game XYZ
I've tried inserting:
As suggested above, tell kodi playback failed, and there is no item to play
xml:
xbmcplugin.setResolvedUrl(plugin.handle,False, xbmcgui.ListItem())
or
Tell kodi playback succeeded, and there is no item to play
xml:
xbmcplugin.setResolvedUrl(plugin.handle,True, xbmcgui.ListItem())
or
Tell kodi playback succeeded, and the item played is my addon path
xml:
xbmcplugin.setResolvedUrl(plugin.handle,True, xbmcgui.ListItem(path='plugin://plugin.program.iagl/play_game/e09ca05cf0b8946dc8c4d5b544bf80d0'))
None of these work, and the response to pressing the play button, then getting the 'playback failed' dialog appears to be indeterminate. Sometimes I get the message and sometimes I dont, so I agree there might be a race condition.