Register Listener for Click events or media states
#1
Hi,

I want to know if it is possible to register my addon for every click event or for specific click events. Alternatively for Media state changes (Play, Stop, Pause).

My intention is to dim my lights up and down if a video is played, stopped, paused or if I am viewing live tv.

Where to start?

Thanks in advance.

Regards

Kilo
Reply
#2
It is possible. You will want to make it a http://kodi.wiki/view/Service_add-ons and you can refer to http://mirrors.kodi.tv/docs/python-docs/...tml#Player for media state changes.
Reply
#3
Perfect.

Thank you very much.
Reply
#4
(2016-01-28, 17:44)curti Wrote: It is possible. You will want to make it a http://kodi.wiki/view/Service_add-ons and you can refer to http://mirrors.kodi.tv/docs/python-docs/...ml#Monitor for media state changes.

And which method exactly monitors playback in Monitor class?Confused

For monitoring playback state you can try xbmc.Player() class with its callback methods or poll boolean conditions: http://kodi.wiki/view/List_of_boolean_conditions
Reply
#5
(2016-01-29, 00:06)Roman_V_M Wrote:
(2016-01-28, 17:44)curti Wrote: It is possible. You will want to make it a http://kodi.wiki/view/Service_add-ons and you can refer to http://mirrors.kodi.tv/docs/python-docs/...ml#Monitor for media state changes.

And which method exactly monitors playback in Monitor class?Confused

For monitoring playback state you can try xbmc.Player() class with its callback methods or poll boolean conditions: http://kodi.wiki/view/List_of_boolean_conditions

Oops. I will edit the post to reflect the correct class to use. I was thinking about waitForAbort because of the service add-on use. As @Roman_V_M pointed out the class should be: http://mirrors.kodi.tv/docs/python-docs/...tml#Player or you can also refer to the boolean conditions.
Reply
#6
Already found out and finished my Plugin. Thank you very much. Saved a lot of time searching
Reply

Logout Mark Read Team Forum Stats Members Help
Register Listener for Click events or media states0