kodi reinitializes homepage when player finishes playing, closing my dialog
#1
I am writing a simple addon for kodi to search and play videos on certain websites. Since I'm new I'm still getting around with xbmc apis.

I use xbmc.Player to directly play videos from scrapped urls, and I use a dead loop inside the script to wait for the playback to finish (I use "player.isPlaying()"). The issue is that when the playback finishes (not stopped by the user), my first call to xbmcgui.Dialog after that always gets automatically closed. The debug log shows that the dialog was opened and immediately closed by kodi because it seems to be reinitializing its homepage. Wonder if there's anything I can do about that.
Reply
#2
Thread moved to add-on development, as that's the more appropriate place for such questions.

Add-on support is for released add-ons.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#3
(2022-12-09, 09:22)mockerizer Wrote: I am writing a simple addon for kodi to search and play videos on certain websites. Since I'm new I'm still getting around with xbmc apis.

I use xbmc.Player to directly play videos from scrapped urls, and I use a dead loop inside the script to wait for the playback to finish (I use "player.isPlaying()"). The issue is that when the playback finishes (not stopped by the user), my first call to xbmcgui.Dialog after that always gets automatically closed. The debug log shows that the dialog was opened and immediately closed by kodi because it seems to be reinitializing its homepage. Wonder if there's anything I can do about that.

I'd try adding a 1 second delay after playback stops and before initializing your Dialog window.  Kodi has things related to skins it often has to deal with when events happen (i.e. playback stops). 


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#4
Thanks. Adding some delay by xbmc.sleep works
Reply
#5
(2022-12-10, 13:43)mockerizer Wrote: Thanks. Adding some delay by xbmc.sleep works

Excellent. Glad it worked.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply

Logout Mark Read Team Forum Stats Members Help
kodi reinitializes homepage when player finishes playing, closing my dialog0