The issue is that I need to get an arrangement with the available audio / video devices, but the function even if I print an array in the console, it does not return one to me, but it returns a promise. How can I get the value of a promiseValue or how can I get the miDevices function to return an array with the available devices?
var miArrDevices = [];
function miDevices(arr){
return navigator.mediaDevices.enumerateDevices()
.then(function(res){
for(var i = 0; i< res.length; i++){
arr.push(res[i].kind)
}
console.log(arr)
return arr
})
}
console.log(miDevices(miArrDevices))