Added video calling
This commit is contained in:
15
src/components/PartyVideo.js
Normal file
15
src/components/PartyVideo.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import React, { useRef, useEffect } from "react";
|
||||
|
||||
function PartyVideo({ stream }) {
|
||||
const videoRef = useRef();
|
||||
|
||||
useEffect(() => {
|
||||
if (videoRef.current) {
|
||||
videoRef.current.srcObject = stream;
|
||||
}
|
||||
}, [stream]);
|
||||
|
||||
return <video ref={videoRef} autoPlay muted />;
|
||||
}
|
||||
|
||||
export default PartyVideo;
|
||||
Reference in New Issue
Block a user