play video in Webview on Floating window play only sound

Issue

I’m trying to implements a webview in a floating window like this library Standout ,everything work well but I get only 1 error is when i play a video in internet, it only play the sound , the screen is black. I have set

mWebView.setWebChromeClient(new WebChromeClient());
mWebView.setWebViewClient(new WebViewClient());
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setPluginsEnabled(true);
mWebView.getSettings().setDomStorageEnabled(true);

http://i.stack.imgur.com/nUEaK.png < screenshot. it’s only plays sound without video. Thanks in Advance.

Solution

try add WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED flag when add WebView into WindowManager

Answered By – shaobin0604

Leave a Comment