Kodi Community Forum
Possible to run a windows command upon starting playback of internal player? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Windows (https://forum.kodi.tv/forumdisplay.php?fid=59)
+---- Thread: Possible to run a windows command upon starting playback of internal player? (/showthread.php?tid=189652)



Possible to run a windows command upon starting playback of internal player? - hsarci - 2014-03-19

I just want to execute one command line command every time I start playback of any video file.

Note, I do use an external player (TMT6) for 3d Bluray playback and it works fine using the playercorexml file.



Thanks for the help.


RE: Possible to run a windows command upon starting playback of internal player? - hsarci - 2014-03-21

Bump.

AnyoneHuh


RE: Possible to run a windows command upon starting playback of internal player? - baijuxavior - 2014-03-21

With some modification, you can use a python script to do that.

Code:
import xbmc,os

class MyPlayer(xbmc.Player) :
    def _init_ (self):
        xbmc.Player._init_(self)

    def onPlayBackStarted(self):
        if xbmc.Player().isPlayingVideo():
            response = os.startfile("C:\\Program Files\\XXX\YYY.exe")

I'm a noob when it comes to python scripting. So I may not be able to help you further.

Try https://app.box.com/s/3tuy0plh9gi89ebjppyc.