我正在尝试用Ionic和ngCordova录制音频。
下面是我的代码:$scope.captureAudio = function() { var options ={ limit: 3,工期: 10 };
$cordovaCapture.captureAudio(options).then(function(audioData) {
// Success! Audio data is here
alert(audioData);
console.log(audioData);
}, function(err) {
// An error occurred. Show a me
我使用Ionic框架构建web和移动(混合)应用程序。我使用和。它们在移动应用程序中运行良好。是否可以在移动设备上的web应用程序(在浏览器中)中使用它们?
现在我正在检查JS代码中的平台:
if (this.platform.is('core')) {
// use web libraries for uploading and crop images
} else {
// use @ionic-native cordova plugins
}
SyntaxError</b>: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Response.Body.json (http.js:1091)
at MapSubscriber.project (auth.service.ts:29)
at MapSubscriber._next (map.js:79)
at MapSubscriber.Subscriber.next (Subscriber.js:93)
at CatchSubscriber.