mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
Cleanup
This commit is contained in:
parent
f1499f7811
commit
febf88ab85
@ -170,14 +170,6 @@ http {
|
|||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /restream-ws/ {
|
|
||||||
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/ {
|
location /live/ {
|
||||||
proxy_pass http://jsmpeg/;
|
proxy_pass http://jsmpeg/;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
|
|||||||
@ -1,16 +1,12 @@
|
|||||||
import { h } from 'preact';
|
import { h } from 'preact';
|
||||||
import { useRef, useEffect } from 'preact/hooks';
|
|
||||||
|
|
||||||
let ws;
|
let ws;
|
||||||
|
|
||||||
function initStream(camera) {
|
function initStream(camera) {
|
||||||
//ws = new WebSocket('ws://127.0.0.1:1984/api/ws?src=garage_cam');
|
ws = new WebSocket(`ws://${window.location.host}/go2rtc/api/ws?src=${camera}`);
|
||||||
ws = new WebSocket(`ws://${window.location.hostname}:${window.location.port}/restream-ws/api/ws?src=${camera}`);
|
|
||||||
ws.onopen = () => {
|
ws.onopen = () => {
|
||||||
console.debug('ws.onopen');
|
|
||||||
pc.createOffer().then(offer => {
|
pc.createOffer().then(offer => {
|
||||||
pc.setLocalDescription(offer).then(() => {
|
pc.setLocalDescription(offer).then(() => {
|
||||||
console.log(offer.sdp);
|
|
||||||
const msg = {type: 'webrtc/offer', value: pc.localDescription.sdp};
|
const msg = {type: 'webrtc/offer', value: pc.localDescription.sdp};
|
||||||
ws.send(JSON.stringify(msg));
|
ws.send(JSON.stringify(msg));
|
||||||
});
|
});
|
||||||
@ -18,7 +14,6 @@ function initStream(camera) {
|
|||||||
}
|
}
|
||||||
ws.onmessage = ev => {
|
ws.onmessage = ev => {
|
||||||
const msg = JSON.parse(ev.data);
|
const msg = JSON.parse(ev.data);
|
||||||
console.debug('ws.onmessage', msg);
|
|
||||||
|
|
||||||
if (msg.type === 'webrtc/candidate') {
|
if (msg.type === 'webrtc/candidate') {
|
||||||
pc.addIceCandidate({candidate: msg.value, sdpMid: ''});
|
pc.addIceCandidate({candidate: msg.value, sdpMid: ''});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user