Posts: 31
Joined: Sep 2011
Reputation:
0
otkaz
Junior Member
Posts: 31
Hi, I looked through the wiki to no avail. I have a main box serving its library to several RPis. I'm using the WOL function to turn it on, but I'm wanting to set the idle shutdown timer on that main box so I don't waste power when nothing is streaming. I'm writing an addon to run on the RPis that sends an inhibit sleep command to the box serving the media whenever they are accessing media. I'm trying to find a way I can check if the pi is currently streaming media from that particular source. I some times turn them on just to stream from addons so in that instance I don't want to inhibit sleep. Any help or suggestions is greatly appreciated.
Posts: 1,506
Joined: Nov 2013
trying to do this client side is silly. the server knows if it serves files.
Posts: 3,447
Joined: Jan 2011
Reputation:
362
pkscout
Team-Kodi Member
Posts: 3,447
xbmc.Player().isPlaying() will return true if the instance of Kodi on which you run the code is playing something. xbmc.Player().isPlayingAudio() will return true if it's playing audio, and xvmc.Player().isPlayingVideo() will return true if it's playing a video file.
Posts: 37
Joined: Jan 2012
Reputation:
1
I think the issue is as soon as a video plays the code stops. You need to keep the scrip alive and test if video is playing at certain intervals.