In my addon, in index.js I have a function which starts like this :
function startScreenCapture(tab = getActiveTab(getMostRecentBrowserWindow())) {
contentWindow = getTabContentWindow(tab);
contentWindow.setTimeout(function() {
contentWindow.navigator.mediaDevices.getUserMedia({audio: false, video: {mediaSource: ‘screen’,width: 1280, height:720}}).then(
function(mediaStream) {
ref_Stream = mediaStream;
var video = contentWindow.document.createElement(‘video’);
…
even in console i get a rejected promise
var a = contentWindow.navigator.mediaDevices.getUserMedia({audio: false, video: {width: 1280, height:720}})
Promise { : “rejected”, : MediaStreamError }
Please help