Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to invoke interface method 'boolean android.widget.MediaController' Exception when I tried to add MediaController #2

Open
chilupa opened this issue Jun 19, 2017 · 1 comment

Comments

@chilupa
Copy link

chilupa commented Jun 19, 2017

So glad that I finally found a solution here for using your optimized VideoView in my app.

I'm trying to add MediaController to the VideoView so that my users can have a control over the Video in my customized MessageAdapter but I'm getting this exception. How do i resolve this? Can you please guide me.

E: FATAL EXCEPTION: main Process: com.apvolution.bcmadmin, PID: 28109
java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.widget.MediaController$MediaPlayerControl.canPause()'
on a null object reference
at android.widget.MediaController.disableUnsupportedButtons(MediaController.java: 323)
at android.widget.MediaController.setEnabled(MediaController.java: 635)
at com.apvolution.bcmadmin.adapter.VideoView$3.onPrepared(VideoView.java: 476)
at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java: 2871)
at android.os.Handler.dispatchMessage(Handler.java: 102)
at android.os.Looper.loop(Looper.java: 154)
at android.app.ActivityThread.main(ActivityThread.java: 6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java: 867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java: 757)
@aman811
Copy link

aman811 commented Oct 9, 2018

@chilupa @aizhang any solution? I am facing the same error.

java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.widget.MediaController$MediaPlayerControl.canPause()' on a null object reference
at android.widget.MediaController.disableUnsupportedButtons(MediaController.java:323)
at android.widget.MediaController.show(MediaController.java:362)
at android.widget.MediaController.show(MediaController.java:314)

Repository owner deleted a comment from guijunchen Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@aman811 @chilupa and others