1
0

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:
James Ketrenos 2022-06-14 17:50:58 -07:00
parent 14115400a3
commit 49d633a7c2

View File

@ -604,6 +604,12 @@ const MediaControl = ({isSelf, peer, className}) => {
if (debug) console.log(`media-control - toggleVideo - ${peer.name}`,
!videoOn);
peer.videoOn = !videoOn;
if (peer.videoOn) {
const video = document.querySelector(`video[data-id="${media.name}"`);
if (video) {
video.play();
}
}
setVideoOn(peer.videoOn);
event.stopPropagation();
}
@ -693,6 +699,7 @@ const MediaControl = ({isSelf, peer, className}) => {
e.target.style.transform = `translate(${translate[0]}px, ${translate[1]}px)`;
}}
/><Video className="Video"
data-id={media.name}
autoPlay='autoplay'
{...media.attributes}/>
</> }