distriqt / airnativeextensions

DEPRECATED: Original repository of the distriqt native extensions and is no longer maintained. Please see our site for the latest ANEs
https://airnativeextensions.com
2 stars 0 forks source link

MediaPlayer ANE, App freeze or crash on removePlayer() #197

Closed webts closed 9 years ago

webts commented 10 years ago

I have a simple app for both iOS & Android, on click a button a video will play full screen. on MediaPlayerEvent.FULLSCREEN_EXIT, MediaPlayerEvent.STOPPED or MediaPlayerEvent.COMPLETE I remove the player with MediaPlayer.service.removePlayer();

on Android the app will crash with "Unfortunately the app has stopped" on iOS 6 the app will freeze with black screen on iOS 7 it works correctly

I have also tried calling stop before removePlayer, no difference Is this a bug or am I missing something

thanks

marchbold commented 10 years ago

Just checking that this is the same request that was logged on the support forum and that this Android log is relevant?

http://distriqt.uservoice.com/forums/199650-general/suggestions/6385463-mediaplayer-ane-app-freeze-or-crash-on-removeplay

https://gist.github.com/webts/5b45f94292f47502295f

I'm going to close the one on the support forum and will just follow it here.

webts commented 10 years ago

Hi, yeah its the same request. its the log from when it crashes on Android device, not sure if its relevant to actual cause

Im able to work around the issue by calling stop(), then setting a timer to remove after stop so my workflow is

marchbold commented 10 years ago

Thanks for mentioning the workaround. I should be able to isolate the problem from there.

What device are you testing on? And also would you be able to provide the logs from the device (using adb logcat)?

SamYStudiO commented 9 years ago

Hey,

got the same pb here is the logcat :

12-05 13:52:43.316: E/AndroidRuntime(24574): FATAL EXCEPTION: main 12-05 13:52:43.316: E/AndroidRuntime(24574): Process: air.com.somfy.appmobile, PID: 24574 12-05 13:52:43.316: E/AndroidRuntime(24574): java.lang.IllegalStateException 12-05 13:52:43.316: E/AndroidRuntime(24574): at android.media.MediaPlayer.getDuration(Native Method) 12-05 13:52:43.316: E/AndroidRuntime(24574): at com.distriqt.extension.mediaplayer.player.MediaPlayerFragment.getDuration(MediaPlayerFragment.java:652) 12-05 13:52:43.316: E/AndroidRuntime(24574): at com.distriqt.extension.mediaplayer.player.MediaPlayerControls.setProgress(MediaPlayerControls.java:373) 12-05 13:52:43.316: E/AndroidRuntime(24574): at com.distriqt.extension.mediaplayer.player.MediaPlayerControls.access$7(MediaPlayerControls.java:367) 12-05 13:52:43.316: E/AndroidRuntime(24574): at com.distriqt.extension.mediaplayer.player.MediaPlayerControls$MessageHandler.handleMessage(MediaPlayerControls.java:700) 12-05 13:52:43.316: E/AndroidRuntime(24574): at android.os.Handler.dispatchMessage(Handler.java:102) 12-05 13:52:43.316: E/AndroidRuntime(24574): at android.os.Looper.loop(Looper.java:157) 12-05 13:52:43.316: E/AndroidRuntime(24574): at android.app.ActivityThread.main(ActivityThread.java:5356) 12-05 13:52:43.316: E/AndroidRuntime(24574): at java.lang.reflect.Method.invokeNative(Native Method) 12-05 13:52:43.316: E/AndroidRuntime(24574): at java.lang.reflect.Method.invoke(Method.java:515) 12-05 13:52:43.316: E/AndroidRuntime(24574): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265) 12-05 13:52:43.316: E/AndroidRuntime(24574): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) 12-05 13:52:43.316: E/AndroidRuntime(24574): at dalvik.system.NativeStart.main(Native Method)