如何返回mediaDevices的值

时间:2020-04-07 13:46:20

标签: javascript ecmascript-6

   const mediaDevices = () => {
      let deviceObj = [];
      navigator.mediaDevices.enumerateDevices()
        .then((devices) => {
            deviceObj = devices;
        });
      return deviceObj;
   }

如果我调用mediaDevices方法,我试图返回设备。我该怎么办?

0 个答案:

没有答案