Open amanzan opened 7 years ago
same problem
In MediaPlayerWrapper
change this:
private boolean inUiThread() {
return Thread.currentThread().getId() == 1;
}
with this:
private boolean inUiThread() {
return Thread.currentThread() == Looper.getMainLooper().getThread();
}
Hi, I cannot modify MediaPlayerWrapper.java file because it is read-only, how can i fix this problem ?
Thanks
@dup23 You should download the entire source code and include it in your project to be able to modify it properly
It works ! Thanks @paolomoschini
I get an exception right after running the sample project, without any modification:
Process: com.volokh.danylo.videolist, PID: 17239 java.lang.RuntimeException: this should be called in Main Thread at com.volokh.danylo.video_player_manager.ui.MediaPlayerWrapper.onVideoSizeChanged(MediaPlayerWrapper.java:214) at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:3270) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)