Support multiple videos.
This commit is contained in:
parent
2d5e570625
commit
991a44b332
|
|
@ -38,6 +38,7 @@ class Api:
|
||||||
web.get("/api/position", self.position),
|
web.get("/api/position", self.position),
|
||||||
web.get("/api/diagnostics", self.diagnostics),
|
web.get("/api/diagnostics", self.diagnostics),
|
||||||
web.post("/api/login", self.login),
|
web.post("/api/login", self.login),
|
||||||
|
web.get("/api/available_streams", self.available_streams),
|
||||||
web.post("/api/mediamtx/auth", self.mediamtx_auth),
|
web.post("/api/mediamtx/auth", self.mediamtx_auth),
|
||||||
web.get("/api/mediamtx/login", self.mediamtx_login),
|
web.get("/api/mediamtx/login", self.mediamtx_login),
|
||||||
web.static("/assets", ui_static_directory),
|
web.static("/assets", ui_static_directory),
|
||||||
|
|
@ -176,3 +177,9 @@ class Api:
|
||||||
resp["message"] = diagnostics
|
resp["message"] = diagnostics
|
||||||
return web.json_response(resp)
|
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)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@ class Facts:
|
||||||
|
|
||||||
self._password = self._node.declare_parameter("password", "password").value
|
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._status_string = None
|
||||||
self._lat_long = None
|
self._lat_long = None
|
||||||
self._diag_msg = None
|
self._diag_msg = None
|
||||||
|
|
@ -119,6 +122,12 @@ class Facts:
|
||||||
def get_password(self):
|
def get_password(self):
|
||||||
return self._password
|
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):
|
def _status_callback(self, msg):
|
||||||
self._status_string = msg.data
|
self._status_string = msg.data
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,3 +2,6 @@
|
||||||
ros__parameters:
|
ros__parameters:
|
||||||
ui_pkg: "am_i_up_ui"
|
ui_pkg: "am_i_up_ui"
|
||||||
listen_port: "8000"
|
listen_port: "8000"
|
||||||
|
video_display_port: "8889"
|
||||||
|
video_streams:
|
||||||
|
- image
|
||||||
Loading…
Reference in New Issue