WebView and HTML5 <video>

后端 未结 13 1696
面向向阳花
面向向阳花 2020-11-22 05:59

I\'m piecing together a cheapo app that amongst other things \"frames\" some of our websites... Pretty simple with the WebViewClient. until I hit the video.

13条回答
  •  被撕碎了的回忆
    2020-11-22 06:13

    Actually, it seems sufficient to merely attach a stock WebChromeClient to the client view, ala

    mWebView.setWebChromeClient(new WebChromeClient());
    

    and you need to have hardware acceleration turned on!

    At least, if you don't need to play a full-screen video, there's no need to pull the VideoView out of the WebView and push it into the Activity's view. It will play in the video element's allotted rect.

    Any ideas how to intercept the expand video button?

提交回复
热议问题