Merge branch 'main' into jose/ui

This commit is contained in:
Jose B
2023-08-08 03:56:56 -05:00
37 changed files with 685 additions and 73 deletions

View File

@@ -1,7 +1,8 @@
import { useEffect, useState } from "react";
import Peer from "simple-peer";
const WebRTC_SERVER_URL = "http://127.0.0.1:1250/offer";
// allow customization of the WebRTC server URL from env
const WEBRTC_SERVER_URL = process.env.NEXT_PUBLIC_WEBRTC_SERVER_URL || "http://127.0.0.1:1250/offer";
const useWebRTC = (stream) => {
const [data, setData] = useState({
@@ -17,7 +18,7 @@ const useWebRTC = (stream) => {
peer.on("signal", (data) => {
if ("sdp" in data) {
fetch(WebRTC_SERVER_URL, {
fetch(WEBRTC_SERVER_URL, {
body: JSON.stringify({
sdp: data.sdp,
type: data.type,