2015-01-04, 13:52
I am quite new to python, but I am trying to write an addon which can control my AVR. Depending on the content playing it should be set accordingly. For that, I need the type of content playing right after i got the notification that the player started.
So far I got
However, I get the error log that "myplayer" is not defined in "onNotification". But I create it a few lines above. What am I doing wrong?
So far I got
Code:
class DenonMonitor(xbmc.Monitor):
myplayer=xbmc.Player()
def __init__(self, *args, **kwargs):
xbmc.Monitor.__init__(self)
def onNotification(self, sender, method, data):
if method == "Player.OnPlay":
PowerOn()
if (myplayer.isPlayingAudio()):
MusicMode()
if (myplayer.isPlayingVideo()):
MovieMode()
monitor = DenonMonitor()
However, I get the error log that "myplayer" is not defined in "onNotification". But I create it a few lines above. What am I doing wrong?