WebRTC-Camera-Resolution
WebRTC-Camera-Resolution copied to clipboard
remove unused 'let stream' as it prevents access to window.stream
The let stream
declaration at the start adds the stream
variable to the script's scope. Unfortunately, this means that all references to stream
such as in gum() do not refer to the intended window.stream
.
In this case, this creates a critical bug where the MediaStreamTrack
of the camera is never correctly stopped, which appears to be a necessary step considering how the page already calls getUserMedia()
on startup. This results in an OverconstrainedError
for all subsequent getUserMedia(constraints)
calls, which essentially makes all the resolution tests erroneous.
For some time now I've been getting nothing but fail: OverconstrainedError
for anything above 640x480 with the WebRTC Camera Resolution Finder on Mac & PC with HD+ capable cameras. This could be the cause.
I am seeing the same issue. I removed 'stream' and set any references to it to window.stream
, but that did not make any difference.