Android Vimeo video inside webview crashing second

2019-05-25 20:45发布

问题:

I am playing vimeo videos inside webview, for source code you can have a look at: Android: Vimeo video not playing inside webview

Now there is another issue, when I play video next time it crashes with following stack:

java.lang.NullPointerException
    at android.webkit.HTML5VideoView.reprepareData(HTML5VideoView.java:231)
    at android.webkit.HTML5VideoViewProxy$VideoPlayer.play(HTML5VideoViewProxy.java:219)
    at android.webkit.HTML5VideoViewProxy.handleMessage(HTML5VideoViewProxy.java:372)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:153)
    at android.app.ActivityThread.main(ActivityThread.java:5034)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
    at dalvik.system.NativeStart.main(Native Method)