diff --git a/docker/rootfs/usr/local/nginx/conf/nginx.conf b/docker/rootfs/usr/local/nginx/conf/nginx.conf
index 687b55bee..c09304c56 100644
--- a/docker/rootfs/usr/local/nginx/conf/nginx.conf
+++ b/docker/rootfs/usr/local/nginx/conf/nginx.conf
@@ -44,7 +44,7 @@ http {
keepalive 1024;
}
- upstream go2rtc_api {
+ upstream go2rtc {
server 127.0.0.1:1984;
keepalive 1024;
}
@@ -178,8 +178,16 @@ http {
proxy_set_header Host $host;
}
- location /restream/ {
- proxy_pass http://go2rtc_api/;
+ location ~ /restream/(.*)$ {
+ proxy_pass http://go2rtc/api/stream.mp4?src=$1;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "Upgrade";
+ proxy_set_header Host $host;
+ }
+
+ location /go2rtc/ {
+ proxy_pass http://go2rtc/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
diff --git a/web/src/routes/Camera.jsx b/web/src/routes/Camera.jsx
index ec3bc7038..ea17fe7a4 100644
--- a/web/src/routes/Camera.jsx
+++ b/web/src/routes/Camera.jsx
@@ -13,6 +13,7 @@ import { usePersistence } from '../context';
import { useCallback, useMemo, useState } from 'preact/hooks';
import { useApiHost } from '../api';
import useSWR from 'swr';
+import VideoPlayer from '../components/VideoPlayer';
const emptyObject = Object.freeze({});
@@ -93,13 +94,29 @@ export default function Camera({ camera }) {
let player;
if (viewMode === 'live') {
- player = (
-
-
-
-
-
- );
+ if (cameraConfig.restream.enabled) {
+ {}}
+ />
+ } else {
+ player = (
+
+
+
+
+
+ );
+ }
} else if (viewMode === 'debug') {
player = (