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