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:
|
if video is not None:
|
||||||
url = subprocess.check_output(["youtube-dl", "-g", "-f", "mp4", video]).decode()
|
url = subprocess.check_output(["youtube-dl", "-g", "-f", "mp4", video]).decode()
|
||||||
audioproc = subprocess.Popen(["omxplayer", url.split("\n")[1]])
|
subprocess.Popen(["omxplayer", url.split("\n")[1]])
|
||||||
videoproc = subprocess.Popen(["omxplayer", "-b", url.split("\n")[0]])
|
subprocess.Popen(["omxplayer", "-b", url.split("\n")[0]])
|
||||||
|
|
||||||
processlist.append(audioproc)
|
|
||||||
processlist.append(videoproc)
|
|
||||||
|
|
||||||
killvideo = request.args.get("killvideo")
|
killvideo = request.args.get("killvideo")
|
||||||
|
|
||||||
if killvideo is not None and killvideo in ["1", "true", "yes"]:
|
if killvideo is not None and killvideo in ["1", "true", "yes"]:
|
||||||
for process in processlist:
|
subprocess.Popen(["pkill", "-f", "omxplayer"])
|
||||||
process.terminate()
|
|
||||||
processlist.remove(process)
|
|
||||||
|
|
||||||
return render_template("index.html", sounds=sounds)
|
return render_template("index.html", sounds=sounds)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user