Make separate path for mse

This commit is contained in:
Nick Mowen 2022-10-31 07:47:51 -06:00
parent 9a14f40c0e
commit ed0b34f9f6
2 changed files with 9 additions and 1 deletions

View File

@ -194,6 +194,14 @@ http {
proxy_set_header Host $host;
}
location /live/mse/ {
proxy_pass http://go2rtc/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
location /live/webrtc/ {
proxy_pass http://go2rtc/;
proxy_http_version 1.1;

View File

@ -3,7 +3,7 @@ import { baseUrl } from '../api/baseUrl';
import { useEffect } from 'preact/hooks';
export default function MsePlayer({ camera, width, height }) {
const url = `${baseUrl.replace(/^http/, 'ws')}live/webrtc/api/ws?src=${camera}`;
const url = `${baseUrl.replace(/^http/, 'ws')}live/mse/api/ws?src=${camera}`;
useEffect(() => {
const video = document.querySelector('#video');