From 37edf3337cc622ea5a6df141d6f6ead7fb3d6cdc Mon Sep 17 00:00:00 2001 From: talksik Date: Thu, 28 Apr 2022 17:00:54 -0500 Subject: [PATCH] something works man...maybe it's just local but let's diagnose at least understand the idea of the transciever id --- packages/web/pages/rtc/index.tsx | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/packages/web/pages/rtc/index.tsx b/packages/web/pages/rtc/index.tsx index 75db5b7..8469a3a 100644 --- a/packages/web/pages/rtc/index.tsx +++ b/packages/web/pages/rtc/index.tsx @@ -66,6 +66,12 @@ export default function VideoChat() { peer.addTransceiver("video"); + console.log(peer.getSenders()); + + const remoteStream = new MediaStream([peer.getSenders()[0].track!]); + + incomingVideoRef.current!.srcObject = remoteStream; + console.log(peer.connectionState); console.log(peer); @@ -109,18 +115,18 @@ export default function VideoChat() { console.log("incoming stream", incomingStream); - if (incomingVideoRef.current) { - toast(`setting incoming stream ref`); - incomingVideoRef.current.srcObject = new MediaStream(incomingStream); + // if (incomingVideoRef.current) { + // toast(`setting incoming stream ref`); + // incomingVideoRef.current.srcObject = new MediaStream(incomingStream); - setInterval(() => { - incomingVideoRef!.current!.play().then(console.log).catch(console.log); - }, 2000); + // setInterval(() => { + // incomingVideoRef!.current!.play().then(console.log).catch(console.log); + // }, 2000); - incomingVideoRef.current.oncanplay = () => - console.log("cannn PLLLAYY VID!!!!"); - incomingVideoRef.current.play().then(console.log).catch(console.log); - } + // incomingVideoRef.current.oncanplay = () => + // console.log("cannn PLLLAYY VID!!!!"); + // incomingVideoRef.current.play().then(console.log).catch(console.log); + // } }; return (