Video plays only once in Webview of Android

后端 未结 3 1327
[愿得一人]
[愿得一人] 2020-12-18 05:01

I am succeeded to play streamed Youtube video from HTML5 content in Webview in Android but now problem is that video plays only first time. After that VideoView

相关标签:
3条回答
  • 2020-12-18 05:10

    Add in your chrome client :

            @Override public void onPrepared(MediaPlayer mp) {
    
            customViewCallback.onCustomViewHidden();
        }
    

    where customViewCallback = callback;

    0 讨论(0)
  • 2020-12-18 05:23

    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.

    0 讨论(0)
  • 2020-12-18 05:29

    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.

    0 讨论(0)
提交回复
热议问题