Executing navigator.getUserMedia()
by regular browser load (not ajax) works fine:
<script>
if(navigator.getUserMedia) {
navigator.getUserMedia({audio: true}, startUserMedia, function(e) {
__log('No live audio input: ' + e);
});
} else {
__log('fail ');
}
</script>
But when I try to load this script via $.getScript
or inside a document that loads by $.ajax
, it doesn't seem to execute at all. Oddly enough, it doesn't execute the successful function startUserMedia, nor does it execute the function which logs "no live audio input".
Is there incompatibility executing the method navigator.getUserMedia()
with Ajax?
I've read over the docs and I can't see anything that would state this. Any help / comments / guidance would be appreciated, I've been going over this for the last few days with no success.
Gist of the document which is being loaded by Ajax: https://gist.github.com/markbratanov/859df0b1a70d1e15446c