Can the following Add-on be developed?
#1
I have a pretty easy question today (at least I hope so). I have the demand for a very specific Add-on which most probably is only useful for me. Since I am a developer and already know a handful languages I am willing to take the necessary time to teach myself how to develop Add-ons for Kodi so I can develop the Add-on I need by myself. But before I take some of my little time I want to make sure that the APIs provided by Kodi allows the following Add-on. Therefor it would be nice if an experienced developer can just tell me if it is possible or not.

The Add-on: Whenever I watched a movie completely a message should appear after returning to main menu with a simple yes-no-question. After answering the question a predefined executable should be started with two parameters: the answer (yes/no) and the path to the movie I just watched.

Thanks in advance!
Daniel!
Reply
#2
You can wait for the onPlayBackEnded callback (https://codedocs.xyz/xbmc/xbmc/group__py...725698fcdb) in a service addon.
Then use xbmcgui.Dialog().yesno (https://codedocs.xyz/xbmc/xbmc/group__py...9d6f522ccf).
Reply
#3
python:

While not xbmc.Player().onPlaybackEnded()):
xbmc.sleep(200)

xbmcgui.Dialog().yesno("your header here","Your message here")
Reply
#4
(2018-03-05, 01:53)Demonstratorz Wrote:
python:

While not xbmc.Player().onPlaybackEnded()):
xbmc.sleep(200)

xbmcgui.Dialog().yesno("your header here","Your message here")
 That is a dangerous function.... A better approach would be to utilize the xbmc.player class to monitor for stopped playback.
https://codedocs.xyz/xbmc/xbmc/group__py...725698fcdb

python:

import xbmc, xbmcgui
class Player(xbmc.Player):
    def __init__(self):
        xbmc.Player.__init__(self, xbmc.Player())
        
    def onPlayBackEnded(self):
        xbmcgui.Dialog().yesno("your header here","Your message here")
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#5
Thanks for the responses! It seems it is possible and you already given me some very useful informations. Thats all I needed. Next step: Lear Add-on development (I will start with the hello world example from the kodi wiki).
Reply

Logout Mark Read Team Forum Stats Members Help
Can the following Add-on be developed?0