Here is an image
and width and height are not 0, but when i print it in console, it
returns 0.
Here is code how I print it:
const video = document.getElementById("remoteVideo");
video.addEventListener('play', () => {
setInterval(async () => {
console.log(video.width);
console.log(video.height);
}, 100)
});
Here is full html:
<!DOCTYPE html>
<html lang="en"></html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
html { height: 100%; }
body { height: 100%; margin: 0; background: #111; text-align: center; }
#remoteVideo { height: 70%; margin-top: 5%; background: #000; }
#localVideo { width: 20%; position: absolute; right: 1.1em; bottom: 1em; border: 1px solid #333; background: #000; }
#callButton { position: absolute; display: none; left: 50%; font-size: 2em; bottom: 5%; border-radius: 1em; }
</style>
<script defer src="static/face-api.min.js"></script>
</head>
<body>
<video id="localVideo" autoplay muted></video>
<video id="remoteVideo" autoplay></video>
<button id="callButton" onclick="createOffer()">✆</button>
<script src="/socket.io/socket.io.js"></script>
<script defer src="static/script.js"></script>
</body>
</html>
What am i doing wrong?