Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8556297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:18:57+00:00 2026-06-11T15:18:57+00:00

I have a webview that has html video inside it. I want to show

  • 0

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 VideoView. This works great in 2.3, however, in 4.x onShowCustomView is never called. The video will still play, however, it is played from within the webview without any controls besides clicking for play and stop.

Also, I have hardwareAccelerated=”true”.

Any idea why onShowCustomView is never called?

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);

    webView = (WebView) findViewById(R.id.webView);

    webView.getSettings().setSupportZoom(true);
    webView.getSettings().setLoadWithOverviewMode(true);
    webView.getSettings().setUseWideViewPort(true);
    webView.getSettings().setBuiltInZoomControls(true);
    webView.getSettings().setJavaScriptEnabled(true);
    webView.getSettings().setDomStorageEnabled(true);
    webView.getSettings().setPluginState(WebSettings.PluginState.ON);
    webView.setWebViewClient(new WebViewClient());
    webView.setWebChromeClient(new MyChromeClient());

    webView.loadUrl(URL);

}

private class MyChromeClient extends WebChromeClient implements
        OnCompletionListener, OnErrorListener, OnPreparedListener {

    @Override
    public void onShowCustomView(View view, CustomViewCallback callback) {
        Log.d("ma", "onShowCustomView");
    }

...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:18:58+00:00Added an answer on June 11, 2026 at 3:18 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have a webview that has a single HTML and a single
I have a webview that has some custom HTML loaded into it. In this
I have a webview that's supposed to show cyrillic text wv.loadData( myStringHtml, html/text, utf-8);
I have view that has a webview and a UIToolbar. I want to create
I have a script that generates a temporary HTML file that has links to
I have an Android application that is a TabHost with a WebView. I use
I have a UIWebView (that has been sized to fully contain the html) and
I have some html content which has to be displayed on android webview. Here
I have an Android/HTML hybrid application that has a small number of nested ViewFlippers
I have a Page in Html which has a big Table. So I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.