-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
I'm trying to play a bit with your plugin but I can't get example running.
Recording seems to be working as I can see feedback with power of microphone,
calling startPlay method returns FAIL.
I use SDK 27, Flutter: 0.1.5
I/flutter ( 8509): PARAMS{file: 1521839341296, position: 0.0}
E/MethodChannel#medcorder_audio( 8509): Failed to handle method call
E/MethodChannel#medcorder_audio( 8509): java.lang.NullPointerException: context param can not be null.
E/MethodChannel#medcorder_audio( 8509): at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1036)
E/MethodChannel#medcorder_audio( 8509): at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1003)
E/MethodChannel#medcorder_audio( 8509): at android.media.MediaPlayer.create(MediaPlayer.java:910)
E/MethodChannel#medcorder_audio( 8509): at android.media.MediaPlayer.create(MediaPlayer.java:887)
E/MethodChannel#medcorder_audio( 8509): at android.media.MediaPlayer.create(MediaPlayer.java:866)
E/MethodChannel#medcorder_audio( 8509): at co.medcorder.medcorderaudio.MedcorderAudioPlugin.startPlay(MedcorderAudioPlugin.java:227)
E/MethodChannel#medcorder_audio( 8509): at co.medcorder.medcorderaudio.MedcorderAudioPlugin.onMethodCall(MedcorderAudioPlugin.java:90)
E/MethodChannel#medcorder_audio( 8509): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:191)
E/MethodChannel#medcorder_audio( 8509): at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:133)
E/MethodChannel#medcorder_audio( 8509): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#medcorder_audio( 8509): at android.os.MessageQueue.next(MessageQueue.java:325)
E/MethodChannel#medcorder_audio( 8509): at android.os.Looper.loop(Looper.java:142)
E/MethodChannel#medcorder_audio( 8509): at android.app.ActivityThread.main(ActivityThread.java:6494)
E/MethodChannel#medcorder_audio( 8509): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#medcorder_audio( 8509): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
E/MethodChannel#medcorder_audio( 8509): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
I/flutter ( 8509): startPlay: fail
Would you be able to help with it?
Many Thanks
# Edit:
I found the issue:
there is context assignment missing in plugin java file MedcorderAudioPlugin.java
You just need to update it so it is:
MedcorderAudioPlugin(Activity _activity) {
this.activity = _activity;
this.context = activity.getApplicationContext();
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels