1

I has a app that loads a url on a WebView.

web = (WebView) findViewById(R.id.webview);

WebSettings settings = web.getSettings();
settings.setJavaScriptEnabled(true);
settings.setJavaScriptCanOpenWindowsAutomatically(false);
settings.setSupportMultipleWindows(false);
settings.setSupportZoom(false);
settings.setPluginsEnabled(true);

web.setVerticalScrollBarEnabled(false);
web.setHorizontalScrollBarEnabled(false);

web.loadUrl(lastUrl);

But a spot that should has Video first shows a "loading" view than disappears, if a tap on it occurs, the sound of the video starts playing but not show.

PS: I came across answers that told to add the hardwareAccelerated flag on Manifest, but this solutions simply does not work here.

Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167

2 Answers2

4

I used settings.setDomStorageEnabled(true) as well with hardwareAccelerated="true" and it's working.

Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167
  • Hey there, I have tested some websites, Videos are shown in Android PIE but is not shown in Android Lolipop... And your solution also not work – Ucdemir Nov 01 '21 at 13:45
1

Did you see this question and the comment from slytron?

By the way setPluginsEnabled is deprecated in favor of setPluginState as of API level 8.

Community
  • 1
  • 1
  • 1
    Yeah.. i did see that questions, but they are specific to an embedded VideoView and not the WebView. PS: setPluginState give the same result as before. – Marcos Vasconcelos Nov 28 '11 at 16:56
  • Can't see any issues with your code and I guess you tested on a real device. Can you give some more info? What's the video format, player, tested API level, HTML ( – David Suppiger Nov 28 '11 at 19:17
  • I tested on a device. The native browser renders the same video. And I'm not sure about video format and other things, it's just happens on all that videos revistaalfa.abril.com.br/videos/ – Marcos Vasconcelos Nov 28 '11 at 19:23