Video will not autoplay if you do not enable your camera; add button to toggle
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
14115400a3
commit
49d633a7c2
@ -604,6 +604,12 @@ const MediaControl = ({isSelf, peer, className}) => {
|
|||||||
if (debug) console.log(`media-control - toggleVideo - ${peer.name}`,
|
if (debug) console.log(`media-control - toggleVideo - ${peer.name}`,
|
||||||
!videoOn);
|
!videoOn);
|
||||||
peer.videoOn = !videoOn;
|
peer.videoOn = !videoOn;
|
||||||
|
if (peer.videoOn) {
|
||||||
|
const video = document.querySelector(`video[data-id="${media.name}"`);
|
||||||
|
if (video) {
|
||||||
|
video.play();
|
||||||
|
}
|
||||||
|
}
|
||||||
setVideoOn(peer.videoOn);
|
setVideoOn(peer.videoOn);
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
@ -693,6 +699,7 @@ const MediaControl = ({isSelf, peer, className}) => {
|
|||||||
e.target.style.transform = `translate(${translate[0]}px, ${translate[1]}px)`;
|
e.target.style.transform = `translate(${translate[0]}px, ${translate[1]}px)`;
|
||||||
}}
|
}}
|
||||||
/><Video className="Video"
|
/><Video className="Video"
|
||||||
|
data-id={media.name}
|
||||||
autoPlay='autoplay'
|
autoPlay='autoplay'
|
||||||
{...media.attributes}/>
|
{...media.attributes}/>
|
||||||
</> }
|
</> }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user