webrtc - get webcam's aspect ratio

Viewed 4611

I'm trying to learn how to develop webRTC applications and I would like to know whether you can get a camera's aspect ratio... (I don't know if it helps, but I'm using webrtc.io, but -if it's better- I could stop using it)

3 Answers

From MDN, you can get the current video stream's aspectRatio from MediaTrackSettings by calling:

stream.getVideoTracks()[0].getSettings().aspectRatio
Related