ngCordova capture not working on device

巧了我就是萌 提交于 2019-12-11 08:35:09

问题


I'm am attempting to record audio using Ionic and ngCordova.

Here is my code: $scope.captureAudio = function() { var options = { limit: 3, duration: 10 };

$cordovaCapture.captureAudio(options).then(function(audioData) {
  // Success! Audio data is here
  alert(audioData);
  console.log(audioData);
}, function(err) {
  // An error occurred. Show a message to the user
  alert(err);
});
};

When I run this in the emulator it works fine and brings up the voice recorder and when the recording is done it logs out the audioData.

When I upload it to ionic view and run it I get nothing. Not even an error.

Has anyone seen anything like this before ?

Thanks Kevin


回答1:


$cordovaCapture plugin is not yet supported by ionic view.

Please see the list of supported plugins in this link.

You can run the code in device directly using run command.

ionic run android



来源:https://stackoverflow.com/questions/31947830/ngcordova-capture-not-working-on-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!