handtrack.js icon indicating copy to clipboard operation
handtrack.js copied to clipboard

Video hard coded set to 20px height?

Open mariovde opened this issue 4 years ago • 1 comments

Hi, in the source: https://github.com/victordibia/handtrack.js/blob/master/src/index.js you put this on line 84: video.style.height = "20px";

Why is that? This makes using the webcam impossible, no?

could you explain why this is there, please?

thanks!

Regards

Mario

mariovde avatar May 17 '21 12:05 mariovde

That is a placeholder value that is preset before we attempt to start stream (IIRC).

On line 98, you can see that video.style.height is properly comptered based on other values ... and aims to maintain aspect ration of the webcam.

video.style.height =parseInt(video.style.width) *  (video.videoHeight / video.videoWidth).toFixed(2) +            "px";

Ensure you have set your video height and video width.

victordibia avatar May 18 '21 14:05 victordibia