ngCordova捕获不在设备上工作 [英] ngCordova capture not working on device

查看:173
本文介绍了ngCordova捕获不在设备上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Ionic和ngCordova录制音频。



这是我的代码:
$ scope.captureAudio = function(){
var options = {limit:3,duration:10};

  $ cordovaCapture.captureAudio(options).then(function(audioData){
//成功!音频数据是这里
alert(audioData);
console.log(audioData);
},函数(错误){
//发生错误。向用户显示消息
alert(err);
});
};

当我在模拟器中运行它时它工作正常并调出录音机,当录音时完成它会注销audioData。



当我将它上传到离子视图并运行它时我什么都没得到。甚至没有错误。



有没有人见过这样的事情?



谢谢
Kevin <离婚观点尚不支持$ cordovaCapture插件。



请参阅此链接中支持的插件列表。



您可以使用run命令直接在设备中运行代码。


ionic运行android



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

解决方案

$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

这篇关于ngCordova捕获不在设备上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆