I have developped a google chrome extension.
I am trying now to integrate webRTC feature inside:
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
console.log("step1");
navigator.getUserMedia({audio: true, video: true}, function(stream){
console.log("step2");
$('#myVideo').prop('src', URL.createObjectURL(stream));
window.localStream = stream;
console.log("step3");
}, function(error){
console.log(error);
});
I got an error:
step1
NavigatorUserMediaError {constraintName: "", message: "", name: "InvalidStateError"}
Any idea ?
Do I need any special permission to use webrtc inside my extension ? and is it possible to access webrtc in a extension ?
regards
Here is the screenshot of what I call the "popup" (extension = popup + background)