0

Why is this code not working:

videoCallButton.onclick = function()
{navigator.getUserMedia(mediaConstraints, handleUserMedia, handleUserMediaError);
};

but this one It is:

videoCallButton.onclick = navigator.getUserMedia(
mediaConstraints, handleUserMedia, handleUserMediaError
);

and the event onclick works everytime page is loaded, without clicking

 videoCallButton.onclick = alert("yes");
jesup
  • 6,765
  • 27
  • 32
  • Please add some more information, like which language this is (prefferably add a tag). – Rian Schmits May 02 '15 at 11:27
  • Are you trying to invoke getUserMedia without the user clicking on something? If so, this works in Firefox, but I believe does not in Chrome (especially since Chrome tends to automatically save permissions they don't want getUserMedia to be invokable on load - Firefox defaults to permission for the session only) – jesup May 08 '15 at 13:46

0 Answers0