2

I have a web that supposed to play an embedded html5 video inside it. the problem is that in samsung galaxy s4 the video does not play but in nexus 4 it does (android version is 4.2.2 in both).

i added android:hardwareAccelerated="true" to the manifest in the activity.

the web view settings are:

WebSettings webSettings = webview.getSettings();
webSettings.setPluginState(PluginState.ON);         
webSettings.setJavaScriptEnabled(true);         
webSettings.setAllowFileAccess(true);
webSettings.setLoadWithOverviewMode(false); // zoom y/n
webSettings.setUseWideViewPort(false); // true = like desktop
webSettings.setPluginsEnabled(true);
webSettings.setBuiltInZoomControls(false);                              
webSettings.setDatabaseEnabled(true);
webSettings.setGeolocationEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setDomStorageEnabled(true);

and the html5 code is:

mDataHtml = "<!DOCTYPE HTML> " +
                        "<html xmlns=\"http://www.w3.org/1999/xhtml\" > " +
                            "<head>" +
                            "</head> " +
                            "<body style=\"margin:0 0 0 0; padding:0 0 0 0; background-color:#343434;\"> " +
                                "<iframe src=\"http://www.dailymotion.com/embed/video/" + mVid + "\" width=\"" + "100%25" + "\" height=\"" + "100%25" + "\" frameborder=\"0\"background-color:\"#343434\">" +
                                "</iframe> " +
                            "</body> " +
                        "</html> ";

I could not find any help to my issue when i searched for that. your help is much needed. thank's in advance.

Shalom Melamed
  • 299
  • 1
  • 4
  • 13

1 Answers1

0

In the Android Manifest, try adding android:hardwareAccelerated="true".

If that doesn't work try looking at WebView and HTML5 <video>.

Community
  • 1
  • 1
BLaZuRE
  • 2,356
  • 2
  • 26
  • 43
  • added it programmtically: getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); and also in the manifest – Shalom Melamed Jun 17 '13 at 13:22