Question

On this HTML5Rocks WebRTC Demo page If i open any of the demos in firefox or chrome i get this error:

getUserMedia() not supported in your browser

When i check: http://caniuse.com/stream It should be working from Chrome 21+ and FF 17+

Interestingly enough, the demo works fine in Opera 12. Can anyone tell me what is wrong with the demo and how to fix it?

[EDIT] Apparently i was not on the latest Chrome (i was still on 33). It was waiting for me to restart to switch to chrome 34. After restarting it worked fine. But it is still not working in firefox.

Was it helpful?

Solution

It is most definitely not. I have tested my WebRTC app and it works just fine. Did you test it as mozGetUserMedia? I am guessing that the site is not utilizing a shim and is only using webkit for its demo implementations. You may want to utilize adapter.js as a shim for your application.

EDIT: yes, it only looks for the non-prefixed and webkit prefixed implementations. Below is code taken from the page itself for the first capture button.

var button = document.querySelector('#capture-button');
var localMediaStream = null;

button.addEventListener('click', function(e) {
  if (navigator.getUserMedia) {
    navigator.getUserMedia('video', function(stream) {
      video.src = stream;
      video.controls = true;
      localMediaStream = stream;
    }, errorCallback);
  } else if (navigator.webkitGetUserMedia) {
    navigator.webkitGetUserMedia({video: true}, function(stream) {
      video.src = window.URL.createObjectURL(stream);
      video.controls = true;
      localMediaStream = stream;
    }, errorCallback);
  } else {
    errorCallback({target: video});
  }
}, false);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top