something works man...maybe it's just local but let's diagnose at least understand the idea of the transciever id

This commit is contained in:
talksik
2022-04-28 17:00:54 -05:00
parent e0a1cde897
commit 37edf3337c
+16 -10
View File
@@ -66,6 +66,12 @@ export default function VideoChat() {
peer.addTransceiver("video"); 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.connectionState);
console.log(peer); console.log(peer);
@@ -109,18 +115,18 @@ export default function VideoChat() {
console.log("incoming stream", incomingStream); console.log("incoming stream", incomingStream);
if (incomingVideoRef.current) { // if (incomingVideoRef.current) {
toast(`setting incoming stream ref`); // toast(`setting incoming stream ref`);
incomingVideoRef.current.srcObject = new MediaStream(incomingStream); // incomingVideoRef.current.srcObject = new MediaStream(incomingStream);
setInterval(() => { // setInterval(() => {
incomingVideoRef!.current!.play().then(console.log).catch(console.log); // incomingVideoRef!.current!.play().then(console.log).catch(console.log);
}, 2000); // }, 2000);
incomingVideoRef.current.oncanplay = () => // incomingVideoRef.current.oncanplay = () =>
console.log("cannn PLLLAYY VID!!!!"); // console.log("cannn PLLLAYY VID!!!!");
incomingVideoRef.current.play().then(console.log).catch(console.log); // incomingVideoRef.current.play().then(console.log).catch(console.log);
} // }
}; };
return ( return (