onPlayBackStopped called after play
#1
Ok, I've been trying to debug this myself for a bit but I'm stuck. I've been trying to figure out a bug in the plugin.audio.squeezebox addon (I'm not the developer of the addon).

Every time the addon calls play() on its xbmc.Player object, its onPlayBackStopped callback gets called right after.

I've tried everything to figure out what's going on, but I just can't see what's causing this behavior. If I edit the code to just do nothing when onPlayBackStopped is triggered, then everything works fine and everything plays (besides from not being able to issue a working stop command).

I know this plugin is old and needs to be updated, but it still works (for the most part).

Can anyone help me with this?
Reply
#2
sound like the plugin was coded incorrectly.
plugins should not use xbmc.Player for playback.

instead, plugins need to create playable listitems :
python:
li.setProperty('IsPlayable', 'true')
and provide the stream url to kodi when the item is selected:
python:
play_item = xbmcgui.ListItem(path=url)
xbmcplugin.setResolvedUrl(addon_handle, True, listitem=play_item)

a basic tutorial can be found in our wiki:
https://kodi.wiki/view/HOW-TO:Audio_addon
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
#3
(2020-04-20, 23:53)ronie Wrote: sound like the plugin was coded incorrectly.
plugins should not use xbmc.Player for playback.

instead, plugins need to create playable listitems :
python:
li.setProperty('IsPlayable', 'true')
and provide the stream url to kodi when the item is selected:
python:
play_item = xbmcgui.ListItem(path=url)
xbmcplugin.setResolvedUrl(addon_handle, True, listitem=play_item)

a basic tutorial can be found in our wiki:
https://kodi.wiki/view/HOW-TO:Audio_addon

Ha, I saw that looking around and thought that might be the issue. I'll give it a try.

Thank You!
Reply

Logout Mark Read Team Forum Stats Members Help
onPlayBackStopped called after play0