From 991a44b332909b227afcc81ca3df838c7ad5c960 Mon Sep 17 00:00:00 2001 From: James Pace Date: Sat, 12 Sep 2026 13:17:55 +0000 Subject: [PATCH] Support multiple videos. --- am_i_up/Api.py | 7 +++++++ am_i_up/Facts.py | 9 +++++++++ params/am_i_up.yaml | 5 ++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/am_i_up/Api.py b/am_i_up/Api.py index 63e9bf3..f749bf8 100644 --- a/am_i_up/Api.py +++ b/am_i_up/Api.py @@ -38,6 +38,7 @@ class Api: web.get("/api/position", self.position), web.get("/api/diagnostics", self.diagnostics), web.post("/api/login", self.login), + web.get("/api/available_streams", self.available_streams), web.post("/api/mediamtx/auth", self.mediamtx_auth), web.get("/api/mediamtx/login", self.mediamtx_login), web.static("/assets", ui_static_directory), @@ -176,3 +177,9 @@ class Api: resp["message"] = diagnostics return web.json_response(resp) + async def available_streams(self, request): + resp = {} + resp["streams"] = self._facts.get_video_streams() + resp["port"] = self._facts.get_video_display_port() + return web.json_response(resp) + diff --git a/am_i_up/Facts.py b/am_i_up/Facts.py index e26ecc4..9bb1806 100644 --- a/am_i_up/Facts.py +++ b/am_i_up/Facts.py @@ -39,6 +39,9 @@ class Facts: self._password = self._node.declare_parameter("password", "password").value + self._video_streams = self._node.declare_parameter("video_streams", [""]).value + self._video_display_port = self._node.declare_parameter("video_display_port", "8889").value + self._status_string = None self._lat_long = None self._diag_msg = None @@ -119,6 +122,12 @@ class Facts: def get_password(self): return self._password + def get_video_streams(self): + return self._video_streams + + def get_video_display_port(self): + return self._video_display_port + def _status_callback(self, msg): self._status_string = msg.data diff --git a/params/am_i_up.yaml b/params/am_i_up.yaml index c73ecac..dfde002 100644 --- a/params/am_i_up.yaml +++ b/params/am_i_up.yaml @@ -1,4 +1,7 @@ /**: ros__parameters: ui_pkg: "am_i_up_ui" - listen_port: "8000" \ No newline at end of file + listen_port: "8000" + video_display_port: "8889" + video_streams: + - image \ No newline at end of file