I want to be able to start and stop omxplayer-sync from a python script.
with the following class I can successfully start the slave player but nothing I tried to stop it worked.
class Player:
p = None
def play(self, video):
if self.p is not None:
print("There is already an omxplayer-sync instance running. Doing nothing. Stop first")
elif self.p is None:
print("No video playing, creating a omxplayer-sync instance")
self.p = Popen(['omxplayer-sync', '-l', VIDEO_PATH + video])
def stop(self):
if self.p is not None:
print("Killing omxplayer-sync process")
self.p.terminate()
self.p.kill()
self.p.send_signal(signal.SIGTERM)
os.kill(self.p.pid, signal.SIGTERM)
self.p = None
elif self.p is None:
print("There is no video to stop")
I want to be able to start and stop omxplayer-sync from a python script.
with the following class I can successfully start the slave player but nothing I tried to stop it worked.