Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import xbmc
- import subprocess,os
- xbmc.log(msg="***WORKING1***",level=xbmc.LOGDEBUG)
- print("**Working1**")
- class MyPlayer(xbmc.Player) :
- def __init__ (self):
- xbmc.Player.__init__(self)
- def onPlayBackStarted(self):
- if xbmc.Player().isPlayingVideo():
- os.system("sudo python ~/.xbmc/addon/script.service.procmanager/resources/stopall.py") #Calls another script to stop proceses
- def onPlayBackEnded(self):
- if (VIDEO == 0): #If no video playing
- os.system("sudo python ~/.xbmc/addon/script.service.procmanager/resources/startall.py") #Calls another script to start proceses
- xbmc.log(msg="***WORKING2***",level=xbmc.LOGDEBUG)
- print("**Working2**")
- player=MyPlayer()
- while(1): #Do this in order to know when video isn't playing
- if xbmc.Player().isPlayingVideo():
- VIDEO = 1
- else:
- VIDEO = 0
- xbmc.sleep(3000) #Repeat (ms)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement