Nexus 5上没有默认录音机,因此调用navigator.device.capture.captureAudio会导致:
04-01 14:48:08.562 W/System.err(24130): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.provider.MediaStore.RECORD_SOUND }
04-01 14:48:08.562 W/System.err(24130): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1632)
04-01 14:48:08.562 W/System.err(24130): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424)
04-01 14:48:08.562 W/System.err(24130): at android.app.Activity.startActivityForResult(Activity.java:3424)
04-01 14:48:08.562 W/System.err(24130): at android.app.Activity.startActivityForResult(Activity.java:3385)
04-01 14:48:08.562 W/System.err(24130): at org.apache.cordova.CordovaActivity.startActivityForResult(CordovaActivity.java:901)
04-01 14:48:08.562 D/CordovaActivity(24130): Paused the application!
04-01 14:48:08.562 D/CordovaWebView(24130): Handle the pause
04-01 14:48:08.562 W/System.err(24130): at org.apache.cordova.mediacapture.Capture.captureAudio(Capture.java:198)
04-01 14:48:08.562 W/System.err(24130): at org.apache.cordova.mediacapture.Capture.execute(Capture.java:99)
04-01 14:48:08.562 W/System.err(24130): at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:65)
04-01 14:48:08.562 W/System.err(24130): at org.apache.cordova.PluginManager.execHelper(PluginManager.java:242)
04-01 14:48:08.562 W/System.err(24130): at org.apache.cordova.PluginManager.exec(PluginManager.java:227)
04-01 14:48:08.562 W/System.err(24130): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53)
04-01 14:48:08.562 W/System.err(24130): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
04-01 14:48:08.562 W/System.err(24130): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
04-01 14:48:08.562 W/System.err(24130): at android.os.Handler.dispatchMessage(Handler.java:102)
04-01 14:48:08.562 W/System.err(24130): at android.os.Looper.loop(Looper.java:136)
使用适用于Nexus 5的cordova / phonegap应用程序的录音机有哪些选项?
答案 0 :(得分:2)
我认为你有两种选择: