Tag: 手机插件

iOS上的Phonegap 3.5媒体插件错误“无法使用AvAudioRecorder开始录制”

我正在尝试让用户在Phonegap应用程序中录制audio文件。 它在Android上运行良好,但在iOS上,当录制开始时,出现以下错误: “无法使用AvAudioRecorder开始录制”。 我使用.wav文件名,我首先创build文件,我已经按照我find的所有说明,我不断收到错误。 这是一段代码: theFileSystem.root.getFile(filename,{create:true},function(fileEntry){ mediaFileURL = fileEntry.toURL(); console.log('Created file ' + mediaFileURL); mediaRec = new Media(mediaFileURL, function(){ //console.log('Media File created'); }, function(err){ alert('Error creating the media file: ' + err.message); console.log(mediaFileURL); for(k in err){ console.log(k + ': ' + err[k]); } stopRecordingFile(); }); mediaRec.startRecord(); },function(err){ alert("Error setting audio file"); }); 我看到控制台消息“Created file …”,所以文件成功创build。 […]

在PhoneGap iPhone暂停事件不能正常工作?

这是我的代码 //This is an event that fires when a PhoneGap application is put into the background. document.addEventListener("pause", onPause, false); //This is an event that fires when a PhoneGap application is retrieved from the background. document.addEventListener("resume", onResume, false); // Handle the pause event function onPause(){ console.log("pause : app is put into background"); } // Handle the […]