navigator.mediaDevices.getUserMedia() returns a MediaStream object with your video and audio streams. This MediaStream object has the getVideoTracks() and getAudioTracks() methods.
getVideoTracks()[0] returns the video stream from the local webcam. This video capture object has a getSettings () method that returns some useful properties, such as:
stream.getVideoTracks()[0].getSettings().deviceId stream.getVideoTracks()[0].getSettings().frameRate stream.getVideoTracks()[0].getSettings().height stream.getVideoTracks()[0].getSettings().width stream.getVideoTracks()[0].getSettings().frameRate
Result, for example:
aspectRatio : 1.3333333333333333
deviceId : "e85a2bd38cb0896cc6223b47c5d3266169524e43b6ab6043d8dd22d60ec01a2f"
frameRate : 30
height : 480
width : 640
aspectRatio - 4x3 (1.3333333333333333) or 16x9 (full screen or not),
deviceId - Id webcam,
framRate - frame rate of your video stream,
width - the width of the video
height - the height of the video.
source share