Show HTML5 Video Fullscreen

后端 未结 2 901
悲&欢浪女
悲&欢浪女 2021-02-09 19:36

I have a webview that has html video inside it. I want to show this video fullscreen so I override onShowCustomView of my WebChromeClient to use a

2条回答
  •  被撕碎了的回忆
    2021-02-09 20:01

    Well after struggling with this for a while, I finally found the cause. In Android 4.x you must show the controls by using the html 'controls' attribute in the 'video' tag. Once you are showing these controls, you can click on the fullscreen button which will then call 'onShowCustomView'. Since embedded video is available in 4.x and you have the option to go to fullscreen with the controls, onShowCustomView will not be called automatically on play. Unfortunately, this is very poorly documented in the Android documentation.

提交回复
热议问题