How do I access the properties of depth stream tracks through getUserMedia()
? The properties I'm trying to get are principalPointX, principalPointY, focalLengthX, focalLengthY
from media tracks
The documentation says I need to set depth
to true, so when I do that, I get an error that forces me to set a video
:
(index):20 Uncaught TypeError: Failed to execute 'getUserMedia' on 'Navigator': At least one of audio and video must be requested
When I try to do this:
navigator.mediaDevices.getUserMedia({video: true, depth: true})
.then(stream => {
video.srcObject = stream;
console.log(stream);
}).catch(console.error)
stream
doesn't return any of the properties I am trying to get like principalPointX
. Any help would be appreciated.