diff --git a/device_server.py b/device_server.py index 09cbc25..fb5dc1d 100644 --- a/device_server.py +++ b/device_server.py @@ -209,11 +209,16 @@ def control_video(): if action == "start": if _video_proc is not None and _video_proc.poll() is None: return jsonify({"status": "already_running", "pid": _video_proc.pid}), 200 - _video_proc = subprocess.Popen( - ["python3", KIOSK_SCRIPT], - stdout=open("/tmp/kiosk.log", "w"), - stderr=subprocess.STDOUT, - ) + try: + log = open("/tmp/kiosk.log", "w") + _video_proc = subprocess.Popen( + ["python3", KIOSK_SCRIPT], + stdout=log, + stderr=subprocess.STDOUT, + env=os.environ.copy(), + ) + except Exception as e: + return jsonify({"error": f"failed to launch kiosk: {e}"}), 500 return jsonify({"status": "started", "pid": _video_proc.pid}), 200 elif action == "stop": diff --git a/display_test_nexio.py b/display_test_nexio.py index 54b5ae0..3fab83d 100644 --- a/display_test_nexio.py +++ b/display_test_nexio.py @@ -10,8 +10,8 @@ class KioskManager: def __init__(self, pipeline): self.pipeline = pipeline self.videos = [ - "file:///root/python/vid.mp4", - "file:///root/python/vid2.mp4" + "file:///root/vid.mp4", + "file:///root/vid2.mp4" ] self.current_video_index = 0