I'm accessing the webcam with this code:
getUserMedia( { 'video': true }, success, failure );
Now I'd like to get the highest resolution possible, up to a limit of 720 vertical pixels, so I change it to this:
getUserMedia( { 'video': {
'optional': [
{ 'height': { 'max': 720 } },
{ 'maxHeight': 720 }
]
} }, success, failure );
But it does nothing. I still get a video which is 480 pixels high.
Weirdly, if I change it to use min
instead of max
, it sort-of works in Chrome (it chooses the highest resolution available, with no limit). Adding a max
makes it fail again. None of these seem to work in FireFox.
I realise constraints are still not really standard, but is there any way with the current state of things to reliably do this?
Update: turns out FireFox only supports 640x480, so this question will have to be Chrome-only for now.