我正在尝试使用 Cordova 插件中的 MediaRecorder 在 android 上进行视频录制活动,并且一切正常,但是当我单击我的按钮开始录制时,我收到一条消息说“应用程序已停止工作”。
这是日志,我不确定原因是什么,因为日志没有说明。任何帮助,将不胜感激。
12-15 01:27:38.025: E/AndroidRuntime(776): FATAL EXCEPTION: main
12-15 01:27:38.025: E/AndroidRuntime(776): java.lang.RuntimeException: start failed.
12-15 01:27:38.025: E/AndroidRuntime(776): at android.media.MediaRecorder.start(Native Method)
12-15 01:27:38.025: E/AndroidRuntime(776): at com.ron.camanon.PushCaptureActivity$1.onClick(PushCaptureActivity.java:64)
12-15 01:27:38.025: E/AndroidRuntime(776): at android.view.View.performClick(View.java:4202)
12-15 01:27:38.025: E/AndroidRuntime(776): at android.widget.CompoundButton.performClick(CompoundButton.java:100)
12-15 01:27:38.025: E/AndroidRuntime(776): at android.view.View$PerformClick.run(View.java:17340)
12-15 01:27:38.025: E/AndroidRuntime(776): at android.os.Handler.handleCallback(Handler.java:725)
12-15 01:27:38.025: E/AndroidRuntime(776): at android.os.Handler.dispatchMessage(Handler.java:92)
12-15 01:27:38.025: E/AndroidRuntime(776): at android.os.Looper.loop(Looper.java:137)
12-15 01:27:38.025: E/AndroidRuntime(776): at android.app.ActivityThread.main(ActivityThread.java:5039)
12-15 01:27:38.025: E/AndroidRuntime(776): at java.lang.reflect.Method.invokeNative(Native Method)
12-15 01:27:38.025: E/AndroidRuntime(776): at java.lang.reflect.Method.invoke(Method.java:511)
12-15 01:27:38.025: E/AndroidRuntime(776): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-15 01:27:38.025: E/AndroidRuntime(776): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
12-15 01:27:38.025: E/AndroidRuntime(776): at dalvik.system.NativeStart.main(Native Method)
更新:这是我在粘贴箱上的代码,第 64 行是 mMediaRecorder.start();
所以我现在的问题是,我有一个黑屏预览,我做错了什么?