WebView and HTML5 <video>

后端 未结 13 1667
面向向阳花
面向向阳花 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:28

    A-M's is similar to what the BrowerActivity does. for FrameLayout.LayoutParams LayoutParameters = new FrameLayout.LayoutParams (768, 512);

    I think we can use

    FrameLayout.LayoutParams LayoutParameters = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FILL_PARENT,
                FrameLayout.LayoutParams.FILL_PARENT) 
    

    instead.

    Another issue I met is if the video is playing, and user clicks the back button, next time, you go to this activity(singleTop one) and can not play the video. to fix this, I called the

    try { 
        mCustomVideoView.stopPlayback();  
        mCustomViewCallback.onCustomViewHidden();
    } catch(Throwable e) { //ignore }
    

    in the activity's onBackPressed method.

提交回复
热议问题