forked from server/soundboard
Simplify video killing as it does not work
This commit is contained in:
parent
3e15a967f8
commit
804891e1d0
@ -41,17 +41,12 @@ def index(sound=None, text=None, video=None):
|
||||
|
||||
if video is not None:
|
||||
url = subprocess.check_output(["youtube-dl", "-g", "-f", "mp4", video]).decode()
|
||||
audioproc = subprocess.Popen(["omxplayer", url.split("\n")[1]])
|
||||
videoproc = subprocess.Popen(["omxplayer", "-b", url.split("\n")[0]])
|
||||
|
||||
processlist.append(audioproc)
|
||||
processlist.append(videoproc)
|
||||
subprocess.Popen(["omxplayer", url.split("\n")[1]])
|
||||
subprocess.Popen(["omxplayer", "-b", url.split("\n")[0]])
|
||||
|
||||
killvideo = request.args.get("killvideo")
|
||||
|
||||
if killvideo is not None and killvideo in ["1", "true", "yes"]:
|
||||
for process in processlist:
|
||||
process.terminate()
|
||||
processlist.remove(process)
|
||||
subprocess.Popen(["pkill", "-f", "omxplayer"])
|
||||
|
||||
return render_template("index.html", sounds=sounds)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user