trying bunch of shit

This commit is contained in:
talksik
2022-04-29 14:12:34 -05:00
parent 37edf3337c
commit c13f74c394
2 changed files with 34 additions and 27 deletions
+6 -6
View File
@@ -27,12 +27,14 @@ async function handleJoin(req: Request, res: Response) {
const peer = new webrtc.RTCPeerConnection({
iceServers: [
{
urls: "stun:stun.stunprotocol.org",
},
{ urls: "stun:stun.stunprotocol.org:3478" },
{ urls: "stun:stun.l.google.com:19302" },
],
});
// allow this peer connection to receive other peoples' streams
peer.ontrack = (e: any) => handleStreams(e, peer, lineId);
// now that remote is set
// allow this peer connection for this specific line to get tracks for this line already
try {
@@ -50,9 +52,7 @@ async function handleJoin(req: Request, res: Response) {
}
peer.addTransceiver("video");
// allow this peer connection to receive other peoples' streams
peer.ontrack = (e: any) => handleStreams(e, peer, lineId);
peer.addTransceiver("audio");
// create connection between server and client who hit this endpoint
const desc = new webrtc.RTCSessionDescription(sdp);