WebRTC-Camera-Resolution icon indicating copy to clipboard operation
WebRTC-Camera-Resolution copied to clipboard

remove unused 'let stream' as it prevents access to window.stream

Open mikeybanez opened this issue 5 years ago • 2 comments

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.

mikeybanez avatar Jul 09 '19 13:07 mikeybanez

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.

octavn avatar Jul 18 '19 09:07 octavn

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.

chadwallacehart avatar Mar 19 '21 15:03 chadwallacehart