Skip to content

Commit

Permalink
fix(web): reinitialize peeer as initiator when user is host
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocroh committed May 17, 2024
1 parent 3652b9e commit ea83a76
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/web/app/room/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ export default function Page(): JSX.Element {
stream: videoRef.current?.srcObject as MediaStream,
});

peerRef.current?.on("stream", (remoteStream) => {
if (remoteRef.current) {
remoteRef.current.srcObject = remoteStream;
}
});

peerRef.current?.on("signal", (signalData) => {
if (signalData.type === "offer") {
sendJsonMessage({
Expand Down

0 comments on commit ea83a76

Please sign in to comment.