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

IllegalStateException when removing FrameVideoView from the layout #22

Open
jauneshortcut opened this issue Sep 18, 2018 · 0 comments
Open

Comments

@jauneshortcut
Copy link

I have a chat where I use FrameVideoView to animate the writing state of the chat bubble (three dots moving up and down). When I remove the FrameVideoView to replace it with the static text chat bubble, an IllegalStateException is thrown. Before I remove the FrameVideoView, I check that the mediaPlayer = null but when it comes toTextureViewImpl.release(), the MediaPlayer is not null and the exception is thrown.

Stack trace is the following:

    java.lang.IllegalStateException
        at android.media.MediaPlayer._stop(Native Method)
        at android.media.MediaPlayer.stop(MediaPlayer.java:1231)
        at com.mklimek.frameviedoview.TextureViewImpl.release(TextureViewImpl.java:138)
        at com.mklimek.frameviedoview.TextureViewImpl.removeVideo(TextureViewImpl.java:150)
        at com.mklimek.frameviedoview.TextureViewImpl.onSurfaceTextureDestroyed(TextureViewImpl.java:103)
        at android.view.TextureView.destroySurface(TextureView.java:237)
        at android.view.TextureView.onDetachedFromWindowInternal(TextureView.java:227)
        at android.view.View.dispatchDetachedFromWindow(View.java:14556)
        at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3063)
        at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3063)
        at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4603)
        at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4576)
        at android.view.ViewGroup.removeView(ViewGroup.java:4507)
        at xxxx.welcome.fragment.NonOnboardingPostAuthFragment$1.onAnimationStart(NonOnboardingPostAuthFragment.java:65)
        at android.view.animation.Animation$1.run(Animation.java:362)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5417)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Any suggestions how to make it work?
PS: it worked six months ago.

@jauneshortcut jauneshortcut changed the title IllegalStateException when removing FrameVideoView's from the layout IllegalStateException when removing FrameVideoView from the layout Sep 18, 2018
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

1 participant