Advertisement
Guest User

Untitled

a guest
Oct 11th, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. import xbmc,xbmcgui
  2. import subprocess,os
  3. import time
  4.  
  5. class MyPlayer(xbmc.Player) :
  6.  
  7. def __init__ (self):
  8. xbmc.Player.__init__(self)
  9.  
  10. def onPlayBackStarted(self):
  11. if xbmc.Player().isPlayingVideo():
  12. os.system("/home/iiidefconiii/HarmonyHubControl/HarmonyHubControl thomasvdalen@gmail.com 4845488$ctugT$! 192.168.1.8 issue_device_command 13630846 L03")
  13. os.system("/home/iiidefconiii/HarmonyHubControl/HarmonyHubControl thomasvdalen@gmail.com 4845488$ctugT$! 192.168.1.8 issue_device_command 13630846 L01")
  14. os.system('hyperion-remote --sourceAutoSelect')
  15.  
  16. def onPlayBackEnded(self):
  17. if (VIDEO == 1):
  18. os.system("/home/iiidefconiii/HarmonyHubControl/HarmonyHubControl thomasvdalen@gmail.com 4845488$ctugT$! 192.168.1.8 issue_device_command 13630846 L04")
  19.  
  20. def onPlayBackStopped(self):
  21. if (VIDEO == 1):
  22. os.system("/home/iiidefconiii/HarmonyHubControl/HarmonyHubControl thomasvdalen@gmail.com 4845488$ctugT$! 192.168.1.8 issue_device_command 13630846 L04")
  23. os.system("/home/iiidefconiii/HarmonyHubControl/HarmonyHubControl thomasvdalen@gmail.com 4845488$ctugT$! 192.168.1.8 issue_device_command 13630846 L01")
  24.  
  25. def onPlayBackPaused(self):
  26. if xbmc.Player().isPlayingVideo():
  27. os.system("/home/iiidefconiii/HarmonyHubControl/HarmonyHubControl thomasvdalen@gmail.com 4845488$ctugT$! 192.168.1.8 issue_device_command 13630846 L04")
  28.  
  29. def onPlayBackResumed(self):
  30. if xbmc.Player().isPlayingVideo():
  31. os.system("/home/iiidefconiii/HarmonyHubControl/HarmonyHubControl thomasvdalen@gmail.com 4845488$ctugT$! 192.168.1.8 issue_device_command 13630846 L03")
  32. time.sleep(3)
  33. os.system('hyperion-remote --sourceAutoSelect')
  34.  
  35. player=MyPlayer()
  36.  
  37.  
  38. while(1):
  39. if xbmc.Player().isPlayingVideo():
  40. VIDEO = 1
  41.  
  42. else:
  43. VIDEO = 0
  44.  
  45. xbmc.sleep(3000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement