Skip to content
webtoapkfree

Why does my WebView app not play videos full screen?

WebView fullscreen video fails when the app doesn't override onShowCustomView, or the page's iframe lacks allowfullscreen. Here's how to tell which.

GuidesNookesh Karri

Light cover card with the title 'Why does my WebView app not play videos full screen?' in dark text and a green accent bar

WebView fullscreen video fails for one of two reasons: the app doesn’t handle fullscreen requests, or the web page never asks for them properly. Android WebView only goes fullscreen when the app overrides onShowCustomView. Without it, WebView tells the page fullscreen isn’t supported, and the player’s fullscreen button does nothing or greys out.

Why WebView fullscreen video needs app code

WebView fullscreen video needs app code because WebView hands the fullscreen view to the app instead of showing it itself. The WebChromeClient reference says onShowCustomView notifies the app “that the current page has entered full screen mode.” From then on, the video renders in a view the app receives, not in the WebView.

The app then has to place that view in a window set up with FLAG_FULLSCREEN. If the app skips the override, the same reference says WebView “will report to the web page it does not support fullscreen mode” and ignores the request. That line explains most “fullscreen button does nothing” reports.

A developer on Stack Overflow fixed exactly this by overriding onShowCustomView and onHideCustomView, and reported it working on Android 9.

Symptoms and where to fix them

Most fullscreen video problems map to one cause, and the fix sits either in your page’s HTML or in the app.

What you see Likely cause Where to fix
Fullscreen button greyed out on every video App doesn’t override onShowCustomView App code
Button works in Chrome, greyed out only on embedded players <iframe> missing allowfullscreen Your page’s HTML
No fullscreen button at all on a <video> No controls attribute Your page’s HTML
Video goes fullscreen but you can’t get back onHideCustomView missing or incomplete App code
Video won’t start until tapped WebView requires a user gesture Page design (tap to play, or muted)

With a no-code tool, you can fix the HTML rows today. The app-code rows need someone who can edit the Android project.

Fixing the page: iframes and video tags

Your page needs to request fullscreen in a way the WebView can honour. Two attributes cover most cases.

Embedded players need allowfullscreen

An embedded player can only go fullscreen if its <iframe> allows it. MDN’s iframe reference says allowfullscreen lets the frame call requestFullscreen(), and that it’s now a legacy form of allow="fullscreen *". Check your embed code looks like this:

<iframe src="https://www.youtube.com/embed/VIDEO_ID"
        allow="fullscreen *" allowfullscreen></iframe>

A developer on the B4X forum saw the YouTube fullscreen button disabled in their WebView app but enabled in desktop Chrome. That split usually means the page is fine and the app is missing the override, so check both.

Self-hosted videos need controls

A plain <video> tag shows no fullscreen button unless you add controls. MDN’s video element reference says controls gives the user volume, seeking and pause/resume. On older Android, one Stack Overflow answer found that adding controls was what made the fullscreen button call onShowCustomView.

The same answer notes onShowCustomView doesn’t fire just because a video starts. It fires when the page asks for fullscreen.

Fixing the app: show and hide the fullscreen view

The app fix is two overrides that always travel together. The WebChromeClient docs say that if you override onShowCustomView, you must also override onHideCustomView, and the reverse.

The steps:

  1. In onShowCustomView, keep the View and its callback, hide the WebView, and add the view to a full-size container.
  2. Hide the system bars so the video fills the screen. The WebView full screen guide covers the status bar part.
  3. In onHideCustomView, remove the view, show the WebView again and restore the system bars.
  4. Make the back button call the stored callback’s onCustomViewHidden() while a video is fullscreen, so back exits the video instead of the page. The post on making back go to the previous page shows where that check fits.

onHideCustomView is required for exiting. Per the reference, the app “must hide the custom View”, and only then does content render in the original WebView again. Skip it and users get stuck in a black fullscreen view.

Autoplay and the user gesture rule

WebView blocks video from starting on its own unless a user taps first. The WebSettings reference says setMediaPlaybackRequiresUserGesture controls this, and “The default is true.”

Browsers add their own rule on top. MDN notes that modern browsers block videos with an unmuted audio track from autoplaying. Two page-side fixes work without touching the app:

  • Start the video from a visible “Play” tap.
  • Add muted alongside autoplay for background clips.

Watch for one trap: autoplay="false" still autoplays, because the attribute’s presence is what counts.

The poster image and black frames

getDefaultVideoPoster is not a fullscreen fix, though forum answers often bundle it in. The WebChromeClient reference says a video that isn’t playing shows a poster image, and this method supplies the default one when the page doesn’t. Set a poster attribute on your <video> and this rarely matters.

What you can do with a no-code builder

With a no-code builder, you control the page, so start with the HTML rows of the table. WebToAPK Free lets you set the app name, package name, icon, colour, theme, navigation and Website, HTML or Text sections. A fullscreen video switch isn’t among those options. It also doesn’t promise every site behaves in a WebView as it does in Chrome.

Fixes on a live site reach installed apps without a rebuild, as the website to APK guide explains. Test a video on a real phone before you publish. If the page has allowfullscreen and controls and the button still does nothing, the gap is in the app’s onShowCustomView handling, and that means editing the Android project.

My take: if video is the main reason people open your app, don’t rely on embedded players inside a WebView at all. Link out to the video in the YouTube app or the browser and keep the WebView for everything else. The limitation: linking out pulls users out of your app, which hurts on a course or members site. In that case, a native project with proper fullscreen handling is the only clean route; native vs WebView helps you weigh it. Game wrappers have the same issue, covered in turning an HTML5 game into an Android app.

FAQ

Why is the fullscreen button greyed out on YouTube videos in my app?

Usually the app’s WebChromeClient doesn’t override onShowCustomView, so WebView tells the page fullscreen isn’t supported and the player disables the button. Check that the iframe has allowfullscreen as well.

Can I fix WebView fullscreen video without changing app code?

Partly. You can add allowfullscreen to iframes and the controls attribute to video tags on your site. If the app itself doesn’t handle onShowCustomView, only an app code change fixes it.

Why won’t my video autoplay inside a WebView app?

Android WebView requires a user gesture to play media by default. Start playback from a tap, or make the video muted, because browsers block unmuted autoplay.

How do users leave fullscreen video in a WebView app?

The app must override onHideCustomView and remove the fullscreen view when the page exits fullscreen. Without it, the page has no way back to the normal WebView.

Does a WebView play video fullscreen automatically when Play is tapped?

No. onShowCustomView is called when the page asks for fullscreen, such as when the user taps the player’s fullscreen button, not on every play.

Sources