stemkoski/stemkoski.github.com

"return not in function" in Webcam-Test in Firefox

Closed this issue · 1 comments

In Firefox, Webcam-Test fails with the error:

SyntaxError: return not in function
Webcam-Test.html (line 45, col 2)

...and we don't get the error message "Sorry. navigator.getUserMedia() is not available"

The faulty code is with the return statement here, as it's outside of a function:

if (!navigator.getUserMedia) 
{
    document.getElementById('errorMessage').innerHTML = 
        'Sorry. <code>navigator.getUserMedia()</code> is not available.';
    return;
}
navigator.getUserMedia({video: true}, gotStream, noStream);

Removed the "return". Thanks for pointing it out.