diff --git a/soundboard.py b/soundboard.py index 5ab2961..76e5956 100644 --- a/soundboard.py +++ b/soundboard.py @@ -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)