Here bundle.js
is bundled through browserify
which includes a module called webrtcsupport
<script type="text/javascript" src="/assets/js/bundle.js"></script>
<script type="text/javascript">
var webrtcSupport = require('webrtcsupport');
console.log(webrtcSupport.getUserMedia);
webrtcSupport.getUserMedia();
</script>
Output in browser(Chrome browser) console:
function webkitGetUserMedia() { [native code] }
Uncaught TypeError: Illegal invocation
Why cant I invoke the above function in this manner and what is the right way of doing it?