Playing HTML5 video on fullscreen in android webview

后端 未结 8 2290
迷失自我
迷失自我 2020-11-22 10:23

Well, I\'ve been searching few days already, how to display HTML5 video in full-screen mode on android WebView.

I managed to play HTML5 videos on my webview. Problem

8条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 10:44

    Thank you so much for that class, Cristian.

    I made a minor tweak to it so that the custom loading view is optional, like so:

      @Override
        public View getVideoLoadingProgressView() // Video will start loading, only called in the case of VideoView (typically API level 10-)
        {
            if (loadingView == null)
            {
                return super.getVideoLoadingProgressView();
            }
            else
            {
                loadingView.setVisibility(View.VISIBLE);
                return loadingView;
            }
        }
    

    I also added a new constructor that just takes two parameters. Anyway, just a minor simplification if you don't need the loading view. Thanks again for providing this.

提交回复
热议问题