navigator.mediaDevices.getUserMedia does not work

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

Yes I had this problem too. That’s why I had to opt to make my addon not a WebExtension but a classic bootstrap - https://github.com/mozilla/addons/issues/145

gUM API is not supported yet - https://bugzilla.mozilla.org/show_bug.cgi?id=1278100

You can see how i did it in my classic bootstrap addon in that first github issue topic. Hopefully they will fix the validation bug soon so I can upload it to the markteplace.