Dam0
By: a guest | Mar 18th, 2010 | Syntax:
None | Size: 1.08 KB | Hits: 128 | Expires: Never
# light.py
#
###############################################
#
# to add to autorun
# execfile("/home/xbmc/.xbmc/scripts/light.py")
#
###############################################
import xbmc,xbmcgui
import subprocess,os
class MyPlayer(xbmc.Player) :
def __init__ (self):
xbmc.Player.__init__(self)
def onPlayBackStarted(self):
if xbmc.Player().isPlayingVideo():
os.system("LightsDim.py")
def onPlayBackEnded(self):
if (VIDEO == 1):
os.system("LightsBright.py")
def onPlayBackStopped(self):
if (VIDEO == 1):
os.system("LightsBright.py")
def onPlayBackPaused(self):
if xbmc.Player().isPlayingVideo():
os.system("LightsBright.py")
def onPlayBackResumed(self):
if xbmc.Player().isPlayingVideo():
os.system("LightsDim.py")
player=MyPlayer()
while(1):
if xbmc.Player().isPlayingVideo():
VIDEO = 1
else:
VIDEO = 0
xbmc.sleep(3000)