Reputation: 529
Reading this article I see that is possible to see the capabilities of input devices. Unfortunately I cant access this.
var video = document.querySelector('video');
var constraints = window.constraints = {
audio: true,
video: true
};
var errorElement = document.querySelector('#errorMsg');
navigator.mediaDevices.getUserMedia(constraints)
.then(function(stream) {
var videoTracks = stream.getVideoTracks();
//console.log('Got stream with constraints:', constraints);
console.log('Using video device: ' + videoTracks[0].label);
var audioTracks = stream.getAudioTracks();
audioTracks.getCapabilities();//xxxx
//...
So, can I assume that is not implemented?
Upvotes: 1
Views: 455
Reputation: 42450
It is not implemented yet in Chrome and Firefox.
While the specification allows browsers to downscale (Chrome does, Firefox does not), they are not allowed to upscale, so finding the device's highest native resolution is easy with getUserMedia
, just request a very high resolution using constraints. The resolution returned will be the max the device can handle.
If you have multiple cameras, it will select the one with the highest resolution, or if you don't want that use the deviceId
constraint to prevent it.
Upvotes: 1