Video plays only once in Webview of Android

会有一股神秘感。 提交于 2019-11-29 07:20:14

Add in your chrome client :

        @Override public void onPrepared(MediaPlayer mp) {

        customViewCallback.onCustomViewHidden();
    }

where customViewCallback = callback;

You got a video working inside a WebView with HTML5? Congrats! I failed trying to do that :(

To fix my issue I ended up leaving a place holder in the HTML and handling the video from native code using the MediaPlayer class.

I had this problem as well. I had to add a seek(0). Seems like the next video played from exactly where the last video ended. So I had to go to the beginning of the video before playing.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!