JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.icecomm.io/icecomm.js"></script>
<video id="localVideo" autoplay></video>
CSS
video {
height: 200px;
width: 200px;
}
JavaScript
var comm = new Icecomm('3kB4PpZaNNFN4r3xhmOVgcPn2D8rzcOTtQFh4gRwmAsaGTPwlm');
comm.connect('custom room', {audio: false});
comm.on('connected', function(peer) {
document.body.appendChild(peer.getVideo());
});
comm.on('local', function(peer) {
var localVideo = document.getElementById("localVideo");
localVideo.src = peer.stream;
});
comm.on('disconnect', function(peer) {
document.getElementById(peer.ID).remove();
});