Android WebView displays Full HD html

I want to display an HD html file (fixed width and height set for 1920x1080 pixels) in a WebView.

Everything works fine on my samsung s2 and s4, but I want to run the application on a Chinese android media player, the site is shown more than the screen (with scroll bars).

I tried the following:

In my html file, I installed:

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

This has no effect. So I tried to install width=1920, but still the same.

I tried adding this to the WebView:

WebSettings settings = myView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setUseWideViewPort(true);
settings.setLoadWithOverviewMode(true);

There is still no effect.

I also checked the display settings on the device, but it set the standard to 1080p.

Any ideas? Thank.

+3
source share
1 answer

Add a meta tag to the html page and specify the sizes of the viewports:

<meta name="viewport" content="height=1080, width=1920, user-scalable=no" />

. Android docs

0

All Articles