2019-07-22, 09:00
Hi Forum,
I am working on a service addon where I recurringly (once per second at least) get the state of the player and which file is playing
I therefore have the following code (simplyfied):
I have 2 problems:
1.) CurrentFielname is always empty.
2.) When I seek in a playing movie xbmc.Player().isPlaying() is quickl alternating between true and false a couple of times before settling to false even though the file is still playing
I have to note that the movie is not part of the library but simply a video file I had lying around for testing
Can you tell my why isPlaying() is behaving like that and how to get the filename of the currently playing file?
Thanks in advance.
Best
LuigiEd
I am working on a service addon where I recurringly (once per second at least) get the state of the player and which file is playing
I therefore have the following code (simplyfied):
python:
if __name__ == '__main__':
monitor = xbmc.Monitor()
xbmc.log("Starting wind machine", xbmc.LOGWARNING)
while not monitor.abortRequested():
if (xbmc.Player().isPlaying()):
currentFileName = xbmc.Player().getPlayingFile()
xbmc.log("Playing: " + currentFileName, xbmc.LOGWARNING)
# do something with file
xbmc.log("Playing stopped", xbmc.LOGWARNING)
I have 2 problems:
1.) CurrentFielname is always empty.
2.) When I seek in a playing movie xbmc.Player().isPlaying() is quickl alternating between true and false a couple of times before settling to false even though the file is still playing
I have to note that the movie is not part of the library but simply a video file I had lying around for testing
Can you tell my why isPlaying() is behaving like that and how to get the filename of the currently playing file?
Thanks in advance.
Best
LuigiEd