Get local media stream once when joining call

This commit is contained in:
Robert Long
2021-08-05 10:39:49 -07:00
parent 304dc2ac32
commit e86bac90a0
3 changed files with 39 additions and 56 deletions

View File

@@ -104,21 +104,21 @@ export function Room({ manager }) {
);
}
function Participant({ userId, feed, muted, local }) {
function Participant({ userId, stream, muted, local }) {
const videoRef = useRef();
useEffect(() => {
if (feed) {
if (stream) {
if (muted) {
videoRef.current.muted = true;
}
videoRef.current.srcObject = feed.stream;
videoRef.current.srcObject = stream;
videoRef.current.play();
} else {
videoRef.current.srcObject = null;
}
}, [feed]);
}, [stream]);
return (
<div className={styles.participant}>