camera: relative url support close #1086 (#1088)

close #1092
This commit is contained in:
Alfredo Monclus 2023-08-21 13:57:39 -03:00 committed by GitHub
parent 2b7ad19d7f
commit c3ef1dd789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,6 +46,10 @@ class Panel(ScreenPanel):
def play(self, widget, cam):
url = cam['stream_url']
if url.startswith('/'):
logging.info("camera URL is relative")
endpoint = self._screen.apiclient.endpoint.split(':')
url = f"{endpoint[0]}:{endpoint[1]}{url}"
vf = ""
if cam["flip_horizontal"]:
vf += "hflip,"
@ -89,5 +93,5 @@ class Panel(ScreenPanel):
def log(self, loglevel, component, message):
logging.debug(f'[{loglevel}] {component}: {message}')
if loglevel == 'error':
if loglevel == 'error' and 'No Xvideo support found' not in message:
self._screen.show_popup_message(f'{message}')